Posted By

iLLUMIN on 11/20/09


Tagged

c


Versions (?)

Celsius -> Fahr


 / Published in: C
 

URL: www.sa1t.ru

This program show two columns of temperature. In left - t of celsius, in right - t. of fahr.

  1. #include <stdio.h>
  2. main()
  3. {
  4. int fahr, celsius;
  5. int lower,upper,step;
  6.  
  7. lower = 0;
  8. upper = 300;
  9. step = 20;
  10.  
  11. fahr = lower;
  12. while(fahr<=upper){
  13. celsius = 5 * (fahr-32) / 9;
  14. printf("%d\t%d\n", fahr,celsius);
  15. fahr = fahr + step;
  16. }
  17. }

Report this snippet  

You need to login to post a comment.