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

Schol-R-LEA commented: Shouldn't that be -273.15 °C (or -459.67 °F, as the case may be)? :) +11

Recommended Answers

All 4 Replies

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!

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...

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

commented: Good point. +13
commented: Indeed! +15

or instead you could
from __future__ import division =))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.