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