tfc.c |
#include <stdio.h> main(){ int fahr; float celsius; int lower, step, upper; lower = 0; step = 20; upper = 300; for(fahr=lower; fahr<=upper; fahr = fahr + step){ printf("%3d %6.1f\n", fahr, fahrtocels(fahr)); } return 0; } float fahrtocels(int fahr){ float cels = (5.0/9.0)*(fahr-32); return cels; } |
James Little |