home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug150.arc / C-STUFF1.LBR / TEMP.C < prev    next >
Text File  |  1979-12-31  |  512b  |  22 lines

  1. /* print Fahrenheit-Celsius table
  2.     for f = 0, 20, ..., 300 */
  3.  
  4. main()
  5.     {
  6.     int lower, upper, step;
  7.     float fahr, celsius;
  8.  
  9.     lower = 0;    /* lower limit of temperature table */
  10.     upper = 300;    /* upper limit */
  11.     step  = 20;    /* step size */
  12.  
  13.     fahr = lower;
  14.     while (fahr <= upper)
  15.  
  16.         {
  17.         celsius = (5.0/9.0) * (fahr-32.0);
  18.         printf("%4.0f %6.1f\n", fahr, celsius);
  19.         fahr =fahr + step;
  20.         }
  21.     }
  22.