The data type supported in a language dictates the type of values which can be processed by the language.
C supports several different types of data, each of which may be represented differently within the computers memory.
Data types are means to identify the type of data and associated operations for handling it. Every variable in C has a data types.
Integers are used to store whole numbers.
In C programming, 4 Bytes memory is allocated for Integer datatype. Size and range of Integer type on 16-bit machine is given below:
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 |