Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
1.40/5 (5 votes)
See more:
this is a homework question:

I have to write a c program that converts temperature degrees Fahrenheit to degrees Celsius. The equation for this conversion is Celsius = 32.0. Have the program convert and display the Celsius temperature corresponding to 98.6 degrees Fahrenheit.
Posted
Comments
Manfred Rudolf Bihy 31-May-11 16:42pm    
Your question is faulty: Celsius does not equal 32.0. 32.0 is a constant and also an equation, but not a formula, which BTW is what you need to do your conversion.
Albert Holguin 31-May-11 16:54pm    
see my solution
Albert Holguin 31-May-11 16:51pm    
You should do your own homework and ask for guidance when you run into a wall, you're not even trying here.

Please look up the formulas here for instance: http://www.csgnetwork.com/tempconvjava.html[^]. Feel free to google another site of which there is an abundance out there on the internets.

Cheers!

-MRB
 
Share this answer
 
Given your formula:
double GetTempCelcius(double TempFahrenheit){return 32.0;}

That was easy!
 
Share this answer
 
Comments
Manfred Rudolf Bihy 31-May-11 17:04pm    
You sly devil! ;)
My 5!
Albert Holguin 31-May-11 19:23pm    
lol, thanks! :D
Albert Holguin 31-May-11 19:21pm    
lol, somebody 1'ed my solution!?! I did exactly what OP asked for!
Manfred Rudolf Bihy 31-May-11 19:46pm    
Yes exactly as written in the specification!
What concerns me more is that the vote was cast by a high reputation member. Three fives one of which is mine with just a one should yield a little more than what you now have received in points.

If you want you can go to your rep points page and look at the votes you received, if there is one vote regarding this question that amounts to something like -16, you can be sure that a high rep member is responsible for that.
Manfred Rudolf Bihy 31-May-11 19:51pm    
I wouldn't be too concerned with a one vote. This happens quite often here on CP that posts are down voted. If you are a steady and diligent poster the up votes will surmount the down votes.
Just keep up the good work. Sometimes giving the correct answer to a question will not fetch you the appreciation which you deserve.

Cheers!
int main()
{
  double farenheid = 56.3;
  printf("%f", CalcCelcius(farenheid));
  return 0;
}

double CalcCelcius(double Tf)
{
  double Tc = (5/9)*(Tf-32);
  return Tc;
}
 
Share this answer
 
Comments
Albert Holguin 1-Jun-11 9:37am    
forgot your forward declaration ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900