Data types
In C program, before storing a data in memory (Store) and using that data (Use), we must give its data type.
Integer Data type:
It is an integer data type. It is used to store an integer. Its size is 4 bytes.
If we use an integer data type in the program it will take 4 bytes in memory.
Eg:
0,1,4,5,-3,-2 can only return integers like this.
Float data type:
Using this you can store only numbers with dot(.) in memory.This also takes 4 bytes to store a value in memory.
Eg:
1.5,3.67,4.55,.4.77
Such fractional numbers should be given.
Double data type:
This also can store only dotted numbers in memory. It takes 8 bytes in memory.
Eg:
1784.5786,-4758.6788474.
Void data type:
It is an incomplete data type. Its memory size is 1 bytes.
Eg:
void display()
The display() function does not return any value to the called function after it has completed its work.
char data type:
Only one character can be stored in it. We have to give the given character inside single quotes. It takes 1 bytes to store one character in memory.
Eg:
'a','c','g','#'
This is how we should give character.