1
0
mirror of https://github.com/krislamo/knrc.git synced 2024-11-10 00:30:35 +00:00
knrc/03-celsius-to-fahrenheit.c

16 lines
315 B
C
Raw Normal View History

#include <stdio.h>
2021-11-06 00:42:05 +00:00
#define LOWER 0
#define UPPER 300
#define STEP 20
/* print Celsius-Fahrenheit table */
int main()
{
int cels;
printf("Celsius\t\tFahrenheit\n==========================\n");
2021-11-06 00:42:05 +00:00
for (cels = LOWER; cels <= UPPER; cels = cels + STEP)
printf("%3d\t\t%10.0f\n", cels, (9.0/5.0)*cels+32);
}