20 lines
368 B
C
20 lines
368 B
C
#include <stdio.h>
|
|
|
|
#define LOWER 0
|
|
#define UPPER 300
|
|
#define STEP 20
|
|
|
|
/* Print Fahrenheit-Celcius table
|
|
for fahr = 0, 20, ..., 300 */
|
|
main() {
|
|
float f, c; /* Fahrenheit and Celcuis Temperature */
|
|
|
|
/* Heading */
|
|
printf("Fahrenheit to Celcius\n");
|
|
|
|
for (f = UPPER; f >= LOWER; f = f - STEP) {
|
|
c = 5.0 / 9.0 * (f - 32);
|
|
printf("%6.1f\t%6.1f\n", f, c);
|
|
}
|
|
}
|
|
|