What is Variable in C and Types of variable with Size and Range

Variables and Types of Variable

C has the following simple data types:
Type                     Size(bits)                       Range
                                                    Lower              Upper   
char or signed char            8           -128                127
unsigned char                    8                0                  255
int or signed int                 16        -32768               32767       
unsigned int                        16            0                   65535
short int or                        8          -128                  127
signed short int   
unsigned short int                8             0                   255
long int or                       32        -2147483648        2147483647
signed long int
unsigned long int               32            0                    4294967295
float                                  32        -3.4E38             3.4E38
double                              64        -1.7E308           1.7E308
long double                     80        -3.4E4932           1.1E4932



NOTE: There is NO Boolean type in C -- you should use char, int or (better) unsigned char.
Unsigned can be used with all char and int types.
To declare a variable in C, do:
   var_type list variables;

    e.g.      int i,j,k;
         float x,y,z;
         char ch;

Labels: