Mega Code Archive

 
Categories / C Tutorial / Data Type
 

The form of a floating-point declaration

float   variable;   /* comment */ When using a floating-point number in printf, the %f conversion is used. To print the expression 1.0/3.0, we use this statement: #include<stdio.h> int main(void){     printf("The answer is %f\n", 1.0/3.0); } The answer is 0.333333