C Tutorial/Data Type/float read — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
(нет различий)

Текущая версия на 13:32, 25 мая 2010

Reading floating-point numbers

<source lang="cpp">#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; 

}</source>

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