fourth exercise
This commit is contained in:
parent
43fcdf7034
commit
60d36096f0
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue