fork download
  1. #include<stdio.h>
  2.  
  3. /* print Fahrenheit-Celsius table for fahr = 0,20 ... 300 */
  4.  
  5. int main()
  6. {
  7. int lower,upper,step;
  8. int celsius,fahr;
  9.  
  10. lower = 0;
  11. upper = 300;
  12. step = 20;
  13.  
  14. fahr = lower;
  15.  
  16. while( fahr <= upper)
  17. {
  18. celsius = 5 * (fahr - 32) / 9;
  19. printf("%d\t%d\n",fahr,celsius);
  20. fahr = fahr + step;
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
0	-17
20	-6
40	4
60	15
80	26
100	37
120	48
140	60
160	71
180	82
200	93
220	104
240	115
260	126
280	137
300	148