summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-05-22 20:50:52 -0600
committermo <mo.khan@gmail.com>2019-05-22 20:50:52 -0600
commita50584c6ab73180482e7d693e3ec4d76bf24c82e (patch)
treeea10e72ff9d8a5e36b01d29f16a8a8020063f5d3 /src
parenteee99baba0c7fe58d1cafc47dda5096650d41ca1 (diff)
create program to read in celsius and print fahrenheit
Diffstat (limited to 'src')
-rw-r--r--src/temperature.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/temperature.c b/src/temperature.c
index de6c280..747201d 100644
--- a/src/temperature.c
+++ b/src/temperature.c
@@ -1,5 +1,10 @@
#include <stdio.h>
int main(int argc, char **argv) {
- printf("Hello");
+ float c, f;
+ printf("Degrees in Celsius?\n");
+ scanf("%f", &c);
+
+ f = 9*c/5 + 32;
+ printf("Degrees in Fahrenheit: %f\n", f);
}