Data Types
- DataTypes are used for declaring variables And functions of different types.
- When Program store data in variables, It is necessary that each variable must be assigned a specific data type.
Following are the list of Data Types in C :
| No. | Keyword | Memory | Range |
|---|---|---|---|
| 1. | char or signed char | 1 Byte | -128 to 127 |
| 2. | unsigned char | 1 Byte | 0 to 255 |
| 3. | int or signed int | 2 Byte | -32,768 - 32,767 |
| 4. | unsigned int | 2 Byte | 0 to 65535 |
| 5. | short int or signed short int | 1 Byte | -128 to 127 |
| 6. | unsigned short int | 1 Byte | 0 to 255 |
| 7. | long or signed long | 4 Bytes | -2,147,483,648 to 2,147,483,647 |
| 8. | unsigned long | 4 Bytes | 0 to 4,294,967,295 |
| 9. | float | 4 Bytes | 3.4E - 38 to 3.4E + 38 |
| 10. | double | 8 Byte | 1.7E - 308 to 1.7E + 308 |
| 11. | long double | 10 Bytes | 3.4E-4932 to 1.1E + 4932 |
Declaration of variable :
main()
{
/* declaration */
//long int is datatype and amount is variable name
long int amount;
//int is datatype and code is variable name
int code;
char c;
double average;
float x,y;
}