diff options
author | sinanmohd <pcmsinan@gmail.com> | 2022-06-04 12:11:15 +0530 |
---|---|---|
committer | sinanmohd <pcmsinan@gmail.com> | 2022-06-04 12:11:15 +0530 |
commit | c24973af02bc33f2f5f25d37e22ca91da5de3c47 (patch) | |
tree | 460a005b6a3a9a967bd881bc2bf01e0becbe33cc /1.15.c |
inital commit
Diffstat (limited to '1.15.c')
-rw-r--r-- | 1.15.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#include <stdio.h> + +#define TRUE 1 + +float conv_temp(int temp_c); + +int +main(void) +{ + int input, temp_c; + while(TRUE) { + printf("Enter temp in C: "); + scanf("%d", &temp_c); + printf("%d C is %.1f F\n", temp_c, conv_temp(temp_c)); + } + + return 0; +} + +float +conv_temp(int temp_c) +{ + return (9.0/5.0 * temp_c) + 32.0; +} |