C Language Example - Output Floating Point Numbers

C 语言实例C Language Examples

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.001234

C Language Examples

other extensions