Implement the following two functions
/* returns Celsius equivalent of a Fahrenheit temperature (ft) */
double celsius(double ft); this part doesn't want to work check code please.
/* returns Fahrenheit equivalent of a Celsius temperature (ct) */
double fahrenheit (double ct); this part Done and works
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double f2c(int f);
double c2f(int i);
int main ( void )
{
int i, f;
double Celsius, Fahrenheit;
printf("\n\t Celsius<->Fahrenheit\n\n\n");
for ( i = 0; i <= 100; i += 2)
{
Fahrenheit = c2f(i);
printf ( "\t%3d \t - %6.2f \n", i, Fahrenheit);
}
printf("\n\tFahrenheit<->Celsius \n");
for ( f = 32; f <= 212; f += 4) {
Celsius = f2c(f);
printf ( "\t%3d \t - %6.2f \n", f, Celsius);
}
system("pause");
}
/*Implementation Fahrenheit to Celsius*/
double f2c(int f)
{
return (5.0 / 9.0) * (f - 32.0);
}
/*Implementation Celsius to Fahrenheit*/ /* NOT Working*/
/*What Exactly I need to change Here*/
double c2f(int i)
return (9.0 / 5.0) * i) + 32;
{
}
Don't assume i know exactly what i have to change that's why I'm asking, I'm begineer and I'm just learning C. If i have anymore errors please let me know where to correct it. Thanks
[B]Errors I Get:[/B]
In function `double c2f(int)':
40 expected identifier before '(' token
40 named return values are no longer supported