Hi there. Here is the my code:
void fahrenheitFromCelsius (float cel)
{
lastTemprature = cel;
float fahr = cel * 1.8 + 32;
printf("%f Celsius is %f Fahrenheit.\n", cel, fahr);
}
int main(int argc, const char * argv[])
{
float freezeInC = 0;
float freezeInF = fahrenheitFromCelsius(freezeInC);
printf("Water freezes at %f degrees Fahrenheit.\n", freezeInF);
printf("The last temprature converted was %f.\n", lastTemprature);
return EXIT_SUCCESS;
}
My question is: why i can not use “void” to create functions(like in my first line of code) if i want to get value like this:
float freezeInF = fahrenheitFromCelsius(freezeInC);
P.S: When i try it `float fahrenheitFromCelsius(float cel);
So basicly, we can’t use type of float with void,but i don’t know why.Thank you for responding.