home *** CD-ROM | disk | FTP | other *** search
/ Dream 41 / Amiga_Dream_41.iso / Amiga / Programmation / c / PDC.lha / PDC / bin.lzh / sample / fahr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-06  |  289 b   |  17 lines

  1. main()
  2. {
  3.     int fahr, lower, upper, step;
  4.     float celsius;
  5.  
  6.     lower = 0;
  7.     upper = 300;
  8.     step = 20;
  9.  
  10.     fahr = lower;
  11.     while (fahr <= upper)    {
  12.         celsius = (5.0/9.0) * (fahr-32.0);
  13.         printf("%4d %6.1f\n", fahr, celsius);
  14.         fahr = fahr + step;
  15.         }
  16. }
  17.