c_exercises/1-15.c

12 lines
220 B
C
Raw Permalink Normal View History

2022-11-05 18:18:13 -03:00
#include <stdio.h>
double fahr_to_celsius(int fahr){
return (5.0/9.0)*(fahr-32);
}
int main(){
int fahr;
for (fahr=300; fahr>=0; fahr-=20){
printf("%3d %6.1f\n", fahr, fahr_to_celsius(fahr));
}
2022-11-05 18:29:08 -03:00
return 0;
2022-11-05 18:18:13 -03:00
}