Add both header for the entire table, and individual headers denoting which column is which unit.

This commit is contained in:
Reina Harrington-Affine 2025-07-29 14:17:11 -07:00
parent 67483eaceb
commit 357347ae6e
2 changed files with 6 additions and 1 deletions

Binary file not shown.

View file

@ -13,10 +13,15 @@ int main()
step = 20; /* step size between calculated conversions*/ step = 20; /* step size between calculated conversions*/
fahr = lower; fahr = lower;
printf("Temperature conversion table with 20-degree^f steps. \n");
printf("%4s\t%6s\n", "DegF", "DegC");
while (fahr <= upper) while (fahr <= upper)
{ {
celsius = (5.0/9.0) * (fahr-32); celsius = (5.0/9.0) * (fahr-32);
printf("%3.0f\t%6.1f\n", fahr, celsius); printf("%4.0f\t%6.1f\n", fahr, celsius);
fahr = fahr + step; fahr = fahr + step;
} }
return 0; return 0;