A data type is a classification of data that tells the compiler or interpreter how the programmer intends to use the data. In other words, you can say that it defines the size (BYTE) and the range of a variable.
Classification of the data types in C language
1. Pre-define data types (int, char, float, etc) 2. User-define data types ( struct, union, enum)
In C language, different data types have different ranges. The range varies from compiler to compiler. In the below table, I have listed some data types with there ranges and format specifier as per the 32-bit GCC compiler.
Data Type Memory(bytes) Range Format Specifier
short int 2-32,768 to 32,767 %hd
unsigned short int 20 to 65,535 %hu
unsigned int 40 to 4,294,967,295 %u
int 4-2,147,483,648 to 2,147,483,647 %d
long int 4-2,147,483,648 to 2,147,483,647 %ld
unsigned long int 40 to 4,294,967,295 %lu
long long int 8 -(2^63)to(2^63)-1 %lld
unsigned long long int 80 to 18,446,744,073,709,551,615 %llu
Ans:
A data type is a classification of data that tells the compiler or interpreter how the programmer intends to use the data. In other words, you can say that it defines the size (BYTE) and the range of a variable.
Classification of the data types in C language
1. Pre-define data types (int, char, float, etc)
2. User-define data types ( struct, union, enum)
In C language, different data types have different ranges. The range varies from compiler to compiler. In the below table, I have listed some data types with there ranges and format specifier as per the 32-bit GCC compiler.