C Data Types

  • Data types decides that what kind of information need to be hold in a variable.
  • In C programming language there are 3 types of basics data types are available i.e. int, char, float.
  • Whenever the basic data types are not supporting user requirement then go for predefined or primitive data types(are listed in following table)
Data Type Size in Bytes Range Format Specifier
char 1 -128 to 127 %c
unsigned char 1 0 to 255 %C
int 2 -32768 to 32767 %d
unsigned int 2 0 to 65535 %u
long int 4 -2147483648 to
214483647
%ld
unsigned long 4 0 to 4,294,967,295 %lu
float 4 +/- 3.4*10+/-38 %f
double 8 +/-1.7*10*+/-308 %lf
long double 10 +/-3.4*10*+/-4932 %Lf
  • Advantage of classifying these many types is nothing but utilizing the memory more efficiently and increasing the performance.
  • In implementation when we required character operations then go for char or unsigned char data type.
Powered by k2schools