C language is rich in its data types. Storage representations and machine instructions
to handle constants differs from machine to machine.
The variety of data types available, allow the programmers to select the type
appropriate to the needs of the application, as well as the machine.
In a simple way, we can say that the data type of a variable how much space it
occupies in storage.
C supports three classes of data types-
- Primary or fundamental data types (int, float, double)
- Derived data types(Arrays)
- User-defined data types (structure, union, enum)
Basic data types:
1. Char (128 to 127)
2. Int (32768 to 32767)
3. Float (3.4e – 38 to 3.4e + e38)
4. Double (1.7e – 308 to 1.7e + 308)
5. Char or signed char (-128 to 127)
6. Unsigned char (0 to 265)
7. Int or signed int (-32.768 to 32.767)
8. Unsigned int (0 to 65565)
9. Short int or signed short int (-128 to 127)
10. Unsigned short int (0 to 255)
11. Signed long int or long int (-2,147,483,647 to 2,147,483,647)
12. Unsigned long int (0 to 4,294,967,295)
13. Float (3.4E – 38 to 3.4E + 38)
14. Double (1.7E – 308 to 1.7E + 308)
15. Long double (3.4E – 4932 to 1.1E + 4932)