exc/k&r/01-a-tutorial-introduction/01-04.c

21 lines
336 B
C
Raw Permalink Normal View History

#include <stdio.h>
main()
{
int fahr, celsius;
int lower, upper, step;
lower = 0;
upper = 300;
step = 20;
printf("Cels\tFahr\n");
celsius = lower;
while (celsius <= upper) {
fahr = (celsius / 5) * 9 + 32;
printf("%4d\t%4d\n", celsius, fahr);
celsius = celsius + step;
}
}