C has three types of variables
- Integer Variables
- Floating-point Variables
- Character Variables
- Integer is a whole number.
- It may have a positive or negative value.
- (e.g.) 25, 785, -78, 342
- Four types of integer are
- Int (Takes 2 bytes in memory)
- Short Int (Takes 2 bytes in memory
- Long Int (Takes 4 bytes in memory
- Unsigned Int (Takes 2 bytes in memory, Can Store only positive values)
- These consist of whole numbers with fraction or decimal point.
- These are also called floating point numbers.
- (e.g.) 27.47, 0.14, -2.15
- Three types are
- It takes 4 bytes in memory.
- Represented in decimal or exponential form.
- May be signed or unsigned
- It takes 8 bytes in memory.
- Used to store large floating values.