diff options
Diffstat (limited to '1/3.c')
| -rw-r--r-- | 1/3.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#include <stdio.h> + +int main(int argc, char *argv[]) { + float fahr, celsius; + int lower, upper, step; + + lower = 0; + upper = 300; + step = 20; + fahr = lower; + + printf("fahr\tcelsius\n"); + + while (fahr <= upper) { + celsius = (5.0 / 9.0) * (fahr - 32.0); + printf("%4.0f\t%7.1f\n", fahr, celsius); + fahr = fahr + step; + } + + return 0; +}
\ No newline at end of file |
