2021-11-03 04:37:32 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2021-11-06 00:42:05 +00:00
|
|
|
#define LOWER 0
|
|
|
|
#define UPPER 300
|
|
|
|
#define STEP 20
|
|
|
|
|
2021-11-03 06:09:25 +00:00
|
|
|
/* print Fahrenheit-Celsius table */
|
2021-11-03 04:37:32 +00:00
|
|
|
int main()
|
|
|
|
{
|
2021-11-03 06:09:25 +00:00
|
|
|
int fahr;
|
2021-11-03 04:37:32 +00:00
|
|
|
|
2021-11-03 06:34:51 +00:00
|
|
|
printf("Fahrenheit\tCelsius\n=======================\n");
|
2021-11-06 00:42:05 +00:00
|
|
|
for (fahr = UPPER; fahr >= LOWER; fahr = fahr - STEP)
|
2021-11-03 06:34:51 +00:00
|
|
|
printf("%3d\t\t%7.1f\n", fahr, (5.0/9.0)*(fahr-32));
|
2021-11-03 04:37:32 +00:00
|
|
|
}
|