DATA
TYPES IN ‘c’
Data types are keywords which specify the type of
data which is used in the programs of C language. Different data types have
different storage capacities and different range of data.
There
are mainly two main categories of data types.
PRE-DEFINED DATA TYPES/PRIMARY DATA TYPES
INTEGER TYPE DATA TYPES
Integer type data type is used to store a whole number or integer number
Type | Size(bytes) | Range |
---|---|---|
int or signed int | 2 | -32,768 to 32767 |
unsigned int | 2 | 0 to 65535 |
short int or signed short int | 1 | -128 to 127 |
unsigned short int | 1 | 0 to 255 |
long int or signed long int | 4 | -2,147,483,648 to 2,147,483,647 |
unsigned long int | 4 | 0 to 4,294,967,295 |
FLOAT TYPE DATA TYPE
Float type data types are used to store a real number.
Type | Size(bytes) | Range |
---|---|---|
Float | 4 | 3.4E-38 to 3.4E+38 |
double | 8 | 1.7E-308 to 1.7E+308 |
long double | 10 | 3.4E-4932 to 1.1E+4932 |
CHARACTER DATA TYPE
Character type data type is used to store Character type value
Type | Size(bytes) | Range |
---|---|---|
char or signed char | 1 | -128 to 127 |
unsigned char | 1 | 0 to 255 |
Comments
Post a Comment