fourth exercise

This commit is contained in:
celso 2022-11-05 17:51:03 -03:00
parent 43fcdf7034
commit 60d36096f0
1 changed files with 17 additions and 0 deletions

17
1-4.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
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;
}
}