Reading floating-point numbers : float read « Data Type « C Tutorial






#include <stdio.h>

int main()
{ 
   double a; 
   double b; 
   double c; 
   
   printf( "Enter three floating-point numbers: \n" );
   scanf( "%le%lf%lg", &a, &b, &c );

   printf( "Here are the numbers entered in plain\n" );
   printf( "floating-point notation:\n" );
   printf( "%f\n%f\n%f\n", a, b, c );

   return 0; 

}
Enter three floating-point numbers:
2
1
12
Here are the numbers entered in plain
floating-point notation:
2.000000
1.000000
12.000000








2.19.float read
2.19.1.Reading floating-point numbers