1

i need to write a loop program converting celsius to farenheit using the formula F=9*C/5+32 and terminating at -999

Votes + Comments
Shouldn't that be -273.15 °C (or -459.67 °F, as the case may be)? :)
5
Contributors
4
Replies
42
Views
2 Years
Discussion Span
Last Post by Slavi
0

Sorry, but we don't do your homework for you. FWIW, the actual formula is ((9/5)*C) + 32. Make sure you get your parens correct!

1

If you use the Search function of the forums, you ought to find several threads on this subject. I recommend this one, but then I am biased. :-)

That just leaves you with the loop and the exit condition test. I expect you can figure that part out yourself, though I do have a long history of having my hopes dashed in this regard...

Edited by Schol-R-LEA

2

F = 9 * C/5 + 32
Is the same as
F = (9/5) * C + 32

With Python2 / is integer division, so avoid it by using 5.0 instead of 5

Votes + Comments
Indeed!
Good point.
1

or instead you could
from __future__ import division =))

Edited by Slavi

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.