babycai
2011-07-19 04:32:39 UTC
#include
#define inches = 12
#define meters = 39.37
#define q = 331.3
#define p = 273.15
#define h = 32
float readTemp(float temperature)
{
printf("Please Provide A Temperature In Fahrenheit To Calculate The Speed Of Sound In A Air...\n");
scanf("%f", &temperature);
return (float)temperature;
}
float convertTemp(float fah)
{
float a, b, c;
a = fah - h;
b = (float)5.00 / (float)9.00;
c = a * b;
return (float)c;
}
float calculateSpeed(float celcius)
{
float speed, x, y, z;
x = 1 + celcius;
y = x / p;
z = sqrt(y);
speed = q * z;
return (float)speed;
}
float convertUnit(float speed)
{
float feet, inch;
inch = speed * meters;
feet = inch / inches;
return (float)feet;
}
void display(float Meter, float Feet)
{
printf("The Airspeed Is = \n");
printf("In Meters = %.2f", Meter);
printf("In Feets = %.2f", Feet);
return;
}
int main ()
{
float K, METER, FEET, C, Fah;
Fah = readTemp(K);
C = convertTemp(Fah);
METER = calculateSpeed(C);
FEET = convertUnit(METER);
display(METER,FEET);
printf("\n");
return 0;
}
Error 2 error C2059: syntax error : '='
Error 3 error C2059: syntax error : '='
Error 5 error C2059: syntax error : '='
Error 6 error C2059: syntax error : '='
Error 7 error C2059: syntax error : '='
am i doing something mistake on this program?? thank you..