diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-10 20:53:53 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-10 20:53:53 -0700 |
| commit | 70e597e87a8ac89ac791aa61a00ad7bf043e67b9 (patch) | |
| tree | dbdb926f819981bc086d3e7db23e72feb8cb408f | |
| parent | 897c33aa70c5b74e227542b920db72822931e816 (diff) | |
complete exercise 1-5main
| -rw-r--r-- | src/1-5.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/1-5.c b/src/1-5.c new file mode 100644 index 0000000..37ea8c8 --- /dev/null +++ b/src/1-5.c @@ -0,0 +1,14 @@ +#include <stdio.h> + +/* print fahrenheit to celsius conversion in reverse order + * */ +int main(int argc, const char *argv[]) +{ + int fahr; + + for (fahr = 300; fahr >= 0; fahr = fahr - 20) { + printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32)); + } + + return 0; +} |
