summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin@ashbysoft.com <martin@ashbysoft.com>2022-06-06 15:07:20 +0000
committermartin@ashbysoft.com <martin@ashbysoft.com>2022-06-06 15:07:20 +0000
commit9688990db4ce2078a0027315ca80b5717fc5cacd (patch)
tree40687177adb6db740f8b36017680e6818f37bedc
downloadlearn-c-9688990db4ce2078a0027315ca80b5717fc5cacd.tar.gz
learn-c-9688990db4ce2078a0027315ca80b5717fc5cacd.tar.bz2
learn-c-9688990db4ce2078a0027315ca80b5717fc5cacd.tar.xz
learn-c-9688990db4ce2078a0027315ca80b5717fc5cacd.zip
initial
-rw-r--r--fahr-celc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fahr-celc.c b/fahr-celc.c
new file mode 100644
index 0000000..ccef413
--- /dev/null
+++ b/fahr-celc.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+/* print farenheight-celcius
+conversion table for 0, 20, ...300 */
+int main() {
+ for (float fahr=0.0;
+ fahr<=300.0;
+ fahr+=20.0) {
+ printf("%3.0f %6.1f\n",
+ fahr,
+ (5.0/9.0)*(fahr-32.0));
+ }
+}