Monday, August 22, 2011

Data Types in C

So now we are going to see what exactly Data Types are in C language.Usually Data Types are used to store various types of values which is going to be processed by program.Data types determines allocation of memory for the data or values which are to be processed by program.Following is the list of data types in C:-
1.Integer:- This data type is used to define integer number.
           {
                int a;
                a=2;
           }
2.Float:- This data type is used to define floating point numbers.
           {
              float b;
              b=10.3;
           }
3.Double:-This data type is used to define big floating points number.
           {
             double c;
             c=12000;
           }
4.Character:- This data type is used to define characters and its size is only one byte.
           {
               char option;
               option=d;
           }
 All above are basic data types in C. Further all these data types have different options such as
short int=2 bytes ; unsigned short int=2 bytes ; unsigned int=4 bytes ; long int=4 bytes;

signed char=1byte; unsigned char=1 byte;

long double=8 bytes;

No comments:

Post a Comment