fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double fahrenheit, celsius;
  5. int lower, upper, step;
  6.  
  7. lower = 0, upper = 300, step = 20, fahrenheit = lower;
  8.  
  9. while (fahrenheit <= upper) {
  10. celsius = 5 * (fahrenheit - 32.0) / 9;
  11. printf("%f\t%f\n", fahrenheit, celsius);
  12. fahrenheit = fahrenheit + step;
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
0.000000	-17.777778
20.000000	-6.666667
40.000000	4.444444
60.000000	15.555556
80.000000	26.666667
100.000000	37.777778
120.000000	48.888889
140.000000	60.000000
160.000000	71.111111
180.000000	82.222222
200.000000	93.333333
220.000000	104.444444
240.000000	115.555556
260.000000	126.666667
280.000000	137.777778
300.000000	148.888889