Simple C Program Math Problem. - TechRepublic
General discussion
September 13, 2002 at 02:08 AM
mckay_w

Simple C Program Math Problem.

by mckay_w . Updated 23 years, 9 months ago

Program – Microsoft Visual Studio
Win98

I am attempting to write a program that will convert Celsius to Fahrenheit.
the formula to do this is F= 9 / 5 * C + 32

after inputting 10 as Celsius (which is 50 F)
i kept gettin the answer 42.
i changed the formula to see where it was going wrong, and discovered that it was calculating the answer to 9/5 as 1.0, which is obiously wrong.
it should be 1.8.
it also calculates 9/4 as 2.0 ?????

Any ideas that will help me for the points?

This discussion is locked

All Comments