After reading this C data types topic, you will understand its classification and you will also able to use C data types.
Data Types Classification:
The data types classification in C language as shown below,
Fundamental Data types
These data types are predefined data types in C compiler shown below,
Fundamental Data Types | Number of Bytes (size) | Value Range | Format | Example |
---|---|---|---|---|
int | 2 | -32768 to 32767 | %d | int sum =10; |
char | 1 | -128 to 127 | %c | char a = 'K' |
float | 4 | 3.4e-38 to 3.4e+38 | %f | float a = 3.16; |
double | 8 | 1.7e-308 to 1.7+308 | %lf | double a =1.45; |
Data Type Qualifier or Modifier
A fundamental data type change to new data type by using the qualifier (as signed, unsigned, short or long) with the fundamental data type.
Data Type Qualifier | Number of Bytes (size) | Value Range | Format | Example |
---|---|---|---|---|
unsigned char | 1 | 0 to 255 | %c | unsigned char a = ‘a’; |
unsigned int | 2 | 0 to 65535 | %u | Unsigned int c = 3500; |
long int | 4 | -2147483648 to 2147483647 | %ld | long int c = -2324; |
unsigned long int | 4 | 0 to 4294967295 | %lu | unsigned long int c = 121345; |
long double | 10 | 3.4e-4932 to 1.1e+4932 | %lf | long double a = 5.32e-5; |
Derived Data Types
These data types are derived from fundamental data types in C language. These are