Basic data types available in C programming language are signed char, unsigned char, char, short int, unsigned short int, int, unsigned int, long int, unsigned long int, long long int, unsigned long long int, float, double, long double. Here, we will see basic data types, their size and range.
signed char:
Type | Bytes | Range |
---|---|---|
signed char | 1 byte | -128 to 127 |
unsigned char | 1 byte | 0 to 255 |
char | 1 byte | -128 to 128 |
short int | 2 bytes | -32768 to +32767 |
unsigned short int | 2 bytes | 0 to 65535 |
int | 4 bytes | -2147483648 to +2147483647 |
unsigned int | 4 bytes | 0 to 4294967295 |
long int | 4 bytes | -2147483648 to +2147483647 |
unsigned long int | 4 bytes | 0 to +4294967295 |
long long int | 8 bytes | -9223372036854775808 to 9223372036854775807 |
unsigned long long int | 8 bytes | 0 to 18,446,744,073,709,551,615 |
float | 4 bytes | 3.4e-38 to 3.4e+38 |
double | 8 bytes | 1.7e-308 to 1.7e+308 |
long double | 10 bytes | 3.4e-4932 to 1.1e+4932 |
Format specifiers in c:
Format specifier for signed char is %c
Format specifier for unsigned char is %hhu
Format specifier for char is %c
Format specifier for short int is %hd
Format specifier for unsigned short int is %hu
Format specifier for int is %d
Format specifier for unsigned int is %u
Format specifier for unsigned octal integer is %o
Format specifier for unsigned hexadecimal integer(with a, b, c, d, e, f) is %x
Format specifier for unsigned hexadecimal integer(with A, B, C, D, E, F) is %X
Format specifier for long int is %ld
Format specifier for unsigned long int is %lu
Format specifier for long long int is %lld
Format specifier for unsigned long long int is %llu
Format specifier for float is %f
Format specifier for double is %lf
Format specifier for long double is %Lf
Size of signed char | 1 byte |
Value Range | -(2^7) to (2^7) -1 |
Minimum Value | -128 |
Maximum Value | 127 |
Format Specifier for signed char | %c |
unsigned char:
Size of unsigned char | 1 byte |
Value Range | 0 to (2^8) - 1 |
Minimum Value | 0 |
Maximum Value | 255 |
Format specifier for unsigned char | %hhu |
char:
Size of char | 1 byte |
Value Range | -(2^7) to (2^7) -1 |
Minimum Value | -128 |
Maximum Value | 127 |
Format specifier for char | %c |
short int:
Size of short int | 2 byte |
Value Range | -(2^15) to (2^15) -1 |
Minimum Value | -32768 |
Maximum Value | 32767 |
Format specifier for short int | %hd |
unsigned short int:
Size of unsigned short int | 2 bytes |
Value Range | 0 to (2^16) - 1 |
Minimum Value | 0 |
Maximum Value | 65535 |
Format specifier for unsigned short int | %hu |
int:
Size of integer | 4 bytes |
Value Range | -(2^31) to (2^31) - 1 |
Minimum Value | -2147483648 |
Maximum Value | 2147483647 |
Format specifier for integer | %d |
unsigned int:
Size of unsigned int | 4 bytes |
Value Range | 0 to (2^32) - 1 |
Minimum Value | 0 |
Maximum Value | 4294967295 |
Format specifier for unsigned int | %u |
long int:
Size of long int | 4 bytes |
Value Range | -(2^31) to (2^31) - 1 |
Minimum Value | -2147483648 |
Maximum Value | 2147483647 |
Format specifier for long int | %ld |
unsigned long int:
Size of unsigned long int | 4 bytes |
Value Range | 0 to (2^32) - 1 |
Minimum Value | 0 |
Maximum Value | 4294967295 |
Format specifier for unsigned long int | %lu |
long long int:
Size of unsigned long long int | 8 bytes |
Value Range | -(2^63) to (2^63) + 1 |
Minimum Value | -9,223,372,036,854,775,808 |
Maximum Value | 9,223,372,036,854,775,807 |
Format specifier for long long int | %lld |
unsigned long long int:
Size of unsigned long long int | 8 bytes |
Value Range | 0 to (2^64) - 1 |
Minimum Value | 0 |
Maximum Value | 18,446,744,073,709,551,615 |
Format specifier for unsigned long long int | %llu |
float:
Size of float | 4 bytes |
Value Range | 3.4e-38 to 3.4e+38 |
Minimum Value | 3.4e-38 |
Maximum Value | 3.4e+38 |
Format specifier for float | %f |
e-38 = 1/(10^38)
e+38 = 10^38
double:
Size of double | 8 bytes |
Value Range | 1.7e-308 to 1.7e+308 |
Minimum Value | 1.7e-308 |
Maximum Value | 1.7e+308 |
Format specifier for double | %lf |
long double:
Size of long double | 10 bytes |
Value Range | 3.4e-4932 to 1.1e+4932 |
Minimum Value | 3.4e-4932 |
Maximum Value | 1.1e+4932 |
Format specifier for long double | %Lf or %llf |
Dell Laptop Service center are giving repair service at the door. We should high quality Dell out of warranty Laptop Repair, removal of virus, screen removal, wireless network set up, battery removal, motherboard replacement to several other are offered at budget friendly price and it’s Negotiable. We can fix them all in time by our well experience and certified technicians. If you want to repair your laptop in front of your eyesight, than you may call us: 7217871051
ReplyDelete