Exercise 1-3
🖍ī¸

Exercise 1-3

 
❓
Modify the temperature conversion program to print a heading above the table
#include <stdio.h> /* print Ferenheit-Celsius table for fahr = 0, 20, .... 300; floating point version */ main() { float fahr, celcius; int lower, upper, step; lower = 0; upper = 300; step = 20; fahr = lower; printf("Fahr\tCelsius\t \n"); while(fahr <= upper) { celcius = (5.0/9.0) * (fahr - 32.0); printf("%3.0f %6.1f\n", fahr, celcius); fahr = fahr + step; } }
Run it here: https://replit.com/@AleemIsiaka/clioc12#ex1-3/main.c with the command gcc ./ex1-3/main.c; ./a.out;