Well I'm not sure if I'm on the right track or If I way off but this is what I have so far
Basically, I need the program to accept a number (in Kelvin Degrees) then convert it into Farenheit or Celcius. I have all the correct conversions but I'm struggling with the modular programming aspect of it.Code:#include <stdio.h> #include <ctype.h> void step1() { double temp; printf("Please enter a the sample temperature in Degrees Kelvin\n"); scanf("%lf", &temp); return; } void step2() { double temp; char input; printf("Do you wish to convert the sample into (C)Celcius or (F)Fahrenheit?\n"); scanf("%c", &input); if (input == 'c'){ void step3() } else if (input == 'f'){ void step4() } else printf("Invalid Option!\n"); return; } void step3() { int cel; double temp; cel = (temp-273); printf("Temperature in Celcius =%lf \n",cel); } void step4() { int cel; int fah; double temp; cel = (temp-273); fah = (9*cel/5+32); printf("Temperature in Farenheit =%lf \n", fah); int main() { void step1() void step2() }



LinkBack URL
About LinkBacks


