C Language Example - Output Floating Point Numbers
Usageprintf()and%fOutput floating point numbers.
Example
#include <stdio.h>
int main() {
float f; // Declare floating-point variable
f = 12.001234; // Define floating-point variable
printf("The value of f is %f", f);
return 0;
}
Output result:
f 的值为 12.001234other extensions
C Language Examples