Type
|
Typical Bit Width
|
Typical Range
|
|
|
|
char
|
1byte
|
-127 dan 127 yoki 0 dan 255
|
|
|
|
unsigned char
|
1byte
|
0 dan 255
|
|
|
|
signed char
|
1byte
|
-127 dan 127
|
|
|
|
int
|
4bytes
|
-2147483648 dan 2147483647
|
|
|
0 dan 4294967295
|
unsigned int
|
4bytes
|
|
|
|
signed int
|
4bytes
|
-2147483648 dan 2147483647
|
|
|
|
short int
|
2bytes
|
-32768 dan 32767
|
|
|
|
unsigned short int
|
2bytes
|
0 dan 65,535
|
|
|
|
signed short int
|
2bytes
|
-32768 dan 32767
|
|
|
|
long int
|
8bytes
|
-2,147,483,648 dan
2,147,483,647
|
|
|
|
signed long int
|
8bytes
|
same as long int
|
|
|
|
unsigned long int
|
8bytes
|
0 dan 4,294,967,295
|
|
|
|
long long int
|
8bytes
|
-(2^63) dan (2^63)-1
|
|
|
|
unsigned long long
int
|
8bytes
|
0 dan
18,446,744,073,709,551,615
|
|
|
|
float
|
4bytes
|
|
|
|
|
double
|
8bytes
|
|
|
|
|
long double
|
12bytes
|
|
Ma’lumotlar toifalari
Amallar odatda unar ya’ni bitta operandga qo’llaniladigan amallarga va binar ya’ni ikki operandga qo’llaniladigan amallarga ajratiladi.
Binar amallar additiv ya’ni qo’shuv [+] va ayirish [–] amallariga, hamda multiplikativ ya’ni ko’paytirish [*], bo’lish [/] va modul olish[%] amallariga ajratiladi. Additiv amallarining ustuvorligi multiplikativ amallarining ustuvorligidan pastroqdir. Butun sonni butun songa bo’lganda natija butun songacha yaxlitlanadi. Masalan, 10/3=3, (-10)/3=-3, 10/(-3) =-3.
4-amaliy topshiriq.
“28”, “2”, “11”, “32”, “7”, “51”, “84”, “45”, “16” berilgan butun sonlarni ixtiyoriy saralash usuli orqali dasturi ishlab chiqilsin va taxlil qilinsin.
Dostları ilə paylaş:
|