Ch 5 float freezeInF = fahrenheitFromCelsius(freezeInC);


#1

I can’t figure out why this error on the line:
freezeInF = fahrenheitFromCelsius(freezeInC);
with the error code:
Implicit declaration of function ‘fahrenheitFromCelsius’ is invalid in C99

Any help would be appreciated, I’m sure I’m not too far off.

#include <stdio.h>

float farenheitFromCelsius(float cel)
{
float fahr = cel * 1.8 + 32.0;
printf("%f Celsius is %f Fahrenheit\n", cel, fahr);
return fahr;
}

int main(int argc, const char * argv[])
{

float freezeInC = 0;
float freezeInF = fahrenheitFromCelsius(freezeInC);
printf("Water freezes at %f degrees Fahrenheit\n", freezeInF);
return 0;

}


#2

You have a typo error.

float farenheitFromCelsius(float cel)
vs
float freezeInF = fahrenheitFromCelsius(freezeInC);

farenheit in the function name and fahrenheit when calling it.

Mitch