Project-Scylla/KNR C/ex1_15.c

17 lines
321 B
C
Raw Normal View History

#include <stdio.h>
//A program for converting from C to F, using a function!
float convCelsius(int fh){
return ((fh) - 32) * (5.0 / 9.0);
}
int main(){
printf("%6s, %6s\n", "DEG F", "DEG C");
for(int cFH = -200; cFH <= 400; cFH = (cFH + 10)){
printf("%6.0d | %6.2f\n", cFH, convCelsius(cFH));
}
return 0;
}