C examples for Data Type:Introduction
To display floating-point numbers, use the %f conversion specifier demonstrated next.
#include <stdio.h> int main()/*from www . j a v a 2 s . co m*/ { printf("%f", 55.55); return 0; }
The following example uses the %f conversion specifier to print the contents of a floating point variable:
#include <stdio.h> int main(){/*from w w w .j a v a 2 s .com*/ float result; result = 3.123456; printf("The value of result is %f", result); return 0; }