From 61e32d0e223226881b53a385faf2283e8556ea74 Mon Sep 17 00:00:00 2001 From: Reina Harrington-Affine Date: Tue, 29 Jul 2025 16:57:11 -0700 Subject: [PATCH] Reformatted declarations for some floats to more modern standards. --- KNR C/ex1_1-tempconverter.c | 22 ++++++++-------------- KNR C/ex1_1.out | Bin 15480 -> 15480 bytes 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/KNR C/ex1_1-tempconverter.c b/KNR C/ex1_1-tempconverter.c index bdbf090..409f831 100644 --- a/KNR C/ex1_1-tempconverter.c +++ b/KNR C/ex1_1-tempconverter.c @@ -3,26 +3,20 @@ /* print farenheit-celsius table * for fahr = 0, 20, ..., 300 */ -int main() - { - float fahr; - float lower, upper, step; - - lower = 0; /* lower bound of temp scale*/ - upper = 300; /* upper bound of temp scale*/ - step = 20; /* step size between calculated conversions*/ - - fahr = lower; +int main(){ + float lower = 0; /* lower bound of temp scale*/ + float upper = 300; /* upper bound of temp scale*/ + float step = 20; /* step size between calculated conversions*/ printf("Temperature conversion table with 20-degree^f steps. \n"); printf("%4s\t%6s\n", "DegF", "DegC"); - for (fahr = lower; fahr <=300; fahr = fahr + step) - { + for (float fahr = lower; fahr <=300; fahr = fahr + step){ + fahr = lower; printf("%4.0f\t%6.1f\n", fahr, (5.0/9.0)*(fahr-32)); - } - return 0; } + return 0; +} diff --git a/KNR C/ex1_1.out b/KNR C/ex1_1.out index fd99a6739fe0169133b6ae5019833db67cada956..4f001668ac64125433d2da9fb89ba9a909109544 100755 GIT binary patch delta 119 zcmexS@uOnH0%noWh2~+W87oBBYb}_olec^B>W@!WZ{EUufY-~Tm$jFVfx)Bm_=~mw z{{Q#r72N{j_VR85Q>+`nlIMW(I~aiA#SEaL&-?5dj<@|5Br)F%jx-;Q!$4i^A&0Clc@Opjb7jXUZnP1TLgGVoG zGamzkN9XYui~s%q@6ju|3dHT@T>++8mw_eE0p)iv0Ktnspdy6s*YT703Fa_P-mER; Gs|5g%pfjcb