Data Types in C Programming
There are four basic data types supported by C. Table lists the basic data types with their size in bytes and the range of values.
Type
|
Size In bytes
|
Range
|
char
|
1
|
-128 to +127
|
int
|
2
|
-32768 to +32767
|
float
|
4
|
3.4e-38 to 3.4e+38
|
double
|
8
|
1.7e-308 to 1.7e+308
|
The C provides different qualifiers like signed, unsigned, short and long. By applying the qualifiers to the basic data types, we can change the range of our data type as per need. Table lists the various data types available by applying the qualifiers to the basic data types with their size and range of values.
Type
|
Size
in bytes
|
Range
|
char(signed char)
|
1
|
-128 to +127
|
unsinged char
|
1
|
0 to 255
|
int(signed int)
|
2
|
-32768 to +32767
|
Unsinged int
|
2
|
0 to 65535
|
short int(signed short int)
|
2
|
-32768 to +32767
|
unsigned short int
|
2
|
0 to 65535
|
long int(signed long int)
|
4
|
-2147483648 to +2147483647
|
unsigned long int
|
4
|
0 to 4294967295
|
float
|
4
|
3.4e-38 to 3.4e+38
|
double
|
8
|
1.7e-308 to 1.7+308
|
long double
|
10
|
3.4E-4932 to 3.4E+4932
|
Comments
Post a Comment