Correct Answer - Option 2 : 1.4
Concept:
- In C programming language, float is a data type that allows variables to store decimal values.
- %f is a format specifier used for float data type
- The storage size of the float data type is 4 bytes. This also varies depending upon the processor in the CPU.
- Store up to 6 digits after decimal using float data type. For example, 21.456789 can be stored in a variable using the float data type.
Code:
#include<stdio.h>
int main()
{
printf ("%f",(float) 7/5);
return 0;
}
Output: 1.4
Confusion Point:
Some compiler will output 1.40000 and to get answer upto 1 decimal places execute the below given statement: