fork download
  1. #include <stdio.h>
  2.  
  3. /*
  4.  * Table of Celsius and equivalent Fahrenheit temperature
  5.  */
  6. int main() {
  7. float fahr, celsius;
  8. int lower, upper, step;
  9.  
  10. lower = 0;
  11. upper = 200;
  12. step = 10;
  13. celsius = lower;
  14.  
  15. printf("\tC\tF\t\n");
  16. printf("\t---------------\n");
  17.  
  18. while (celsius < upper) {
  19. fahr = ((9.0/5.0) * celsius) + 32.0;
  20. printf("\t%.0f \t%3.2f\n", celsius, fahr);
  21. celsius = celsius + step;
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 5516KB
stdin
Standard input is empty
stdout
	C	F	
	---------------
	0 	32.00
	10 	50.00
	20 	68.00
	30 	86.00
	40 	104.00
	50 	122.00
	60 	140.00
	70 	158.00
	80 	176.00
	90 	194.00
	100 	212.00
	110 	230.00
	120 	248.00
	130 	266.00
	140 	284.00
	150 	302.00
	160 	320.00
	170 	338.00
	180 	356.00
	190 	374.00