float Data type in C

Data types are used to inform which type of data we want to store or process. float is one data types is present in c. float data type is used when we want to store floateger data. It does not allow us to store fractional values.

Syntax declaration of the float data type variable as follows
datatype variablename;
Ex:
float number;
float id;

Size of the float is 4 bytes. It means the the memory allocated for float variable is 4 bytes. The range of the float -2,147,483,648 to 2,147,483,647 if the float size is 4 bytes.
The range of the float is 2.3E-308 to 1.7E+308 if the float size is 8 bytes. We can check the size of the data type or variable using special operator sizeof .

float size demo program


Output




C is machine dependant programming language. Hence the data types are not fixed. The size depends on the machine.