learn_c/intro/temp3.c

12 lines
235 B
C
Raw Permalink Normal View History

2023-11-13 18:18:50 +00:00
#include <stdio.h>
/* print Fahrenheit-Celsius table */
main()
{
int fahr;
// for (fahr = 0; fahr <= 300; fahr = fahr + 20)
for (fahr = 300; fahr >= 0; fahr = fahr - 20)
printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));
}