I tried searching, and while I found some good info, it did not answer my question. I am fairly new in programming, so forgive me if my question is simplistic.
We are writing a program that the only thing that main can do is call functions. I am not completely sure how to structure my functions when calling them.
This code works, but I do not understand why I need to put "Temp=GetTemp();", and the two following lines in the function Celsius.
Any help is appreciated.
# include <stdio.h>
int main (void)
void Celsius (void)
float Convert, Temp;
printf("Convert Celsius to Farenheit: \n\n");
Temp = GetTemp ();
Convert = CentToFaren (Temp);
float GetTemp (void)
printf("Please enter the temperature to be converted: ");
float CentToFaren (float Temp)
Convert = 32 + (Temp * 180/100);
void PrintTemp (float Convert)
printf("\n\nThe converted temperature is: %4.2f", Convert);