From 174c101fb13ba07a24f99fe004f25cddd67a92e5 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 30 Nov 2024 19:53:05 -0500 Subject: [PATCH] Such temperature --- cc4e/fc_2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cc4e/fc_2.c diff --git a/cc4e/fc_2.c b/cc4e/fc_2.c new file mode 100644 index 0000000..4d67f98 --- /dev/null +++ b/cc4e/fc_2.c @@ -0,0 +1,12 @@ +#include + +#define LOWER 0 /* lower limit of table */ +#define UPPER 300 /* upper limit */ +#define STEP 20 /* step size */ + +int main() { /* Fahrenheit-Celsius table */ + int fahr; + + for (fahr = LOWER; fahr <= UPPER; fahr = fahr + STEP) + printf("%4d %6.1f\n", fahr, (5.0/9.0)*(fahr-32)); +}