From: Cian Bagshaw Date: Sun, 4 Dec 2022 11:02:40 +0000 (+0000) Subject: Added exercise 1-5 X-Git-Url: https://tests.cianb.xyz/?a=commitdiff_plain;h=3fab99fcf9975412fc1a2bdd21bbcfa9a8e113b7;p=cProgLang Added exercise 1-5 --- diff --git a/1/5.c b/1/5.c new file mode 100644 index 0000000..eb28376 --- /dev/null +++ b/1/5.c @@ -0,0 +1,14 @@ +/* + Exercise 1-5. Modify the temperature conversion program to print the table in + reverse order, that is, from 300 degrees to 0. + === +*/ + +#include + +int main () { + float fahr; + for (fahr=300; fahr>=0; fahr-=20) { + printf("%3.0f %6.1f\n", fahr, (5.0/9.0) * (fahr-32.0)); + } +}