- Basic Data Type ( Ex- int, char, float, double )
- Derived Data Type ( Ex- array, pointer, structure, union )
- Enumeration Data Type ( Ex- enum )
- Void Data Type ( Ex- void )
Basic Data Type
Data Types |
Memory Size |
Value range |
Format Specifier |
char |
1 byte |
−128 to 127 |
|
signed char |
1 byte |
−128 to 127 |
%c |
unsigned char |
1 byte |
0 to 255 |
%c |
short |
2 bytes |
−32,768 to 32,767 |
|
signed short |
2 bytes |
−32,768 to 32,767 |
%hi |
unsigned short |
2 bytes |
0 to 65,535 |
%hu |
int |
2 bytes |
−32,768 to 32,767 |
|
signed int |
2 bytes |
−32,768 to 32,767 |
%d. %i |
unsigned int |
2 bytes |
0 to 65,535 |
%u |
long int |
4 bytes |
-2,147,483,648 to 2,147,483,647 |
|
signed long int |
4 bytes |
-2,147,483,648 to 2,147,483,647 |
%lli, %lld |
unsigned long int |
4 bytes |
0 to 4,294,967,295 |
%llu |
float |
4 bytes |
1.2E-38 to 3.4E+38 |
%f |
double |
8 bytes |
2.3E-308 to 1.7E+308 |
%lf |
long double |
10 bytes |
3.4E-4932 to 1.1E+4932 |
%Lf |
int
int student_ID, intcustomer_age;
Float and Double
float salary, iteam_price; double speed_of_light;
char
char test = 'K';
0 Comments