diff --git a/1-4.c b/1-4.c new file mode 100644 index 0000000..7f533f9 --- /dev/null +++ b/1-4.c @@ -0,0 +1,17 @@ +#include +int main(){ + float fahr, celsius; + float lower, upper, step; + + lower = 0; /* lower limit of temperature scale */ + upper = 300; /* upper limit */ + step = 20; /* step size */ + + celsius = lower; + printf("fahrenheit celsius\n"); + while (celsius <= upper) { + fahr = ((9.0/5.0) * celsius)+32.0; + printf("%10.0f %7.1f\n", celsius, fahr); + celsius = celsius + step; + } +}