> I need a program that has two variables, temp C and temp F that decrements until the two values are the same...?

I need a program that has two variables, temp C and temp F that decrements until the two values are the same...?

Posted at: 2014-12-18 
After each decrement of tempC, set tempF = 32 + 9*tempC/5.

In most languages, the loop condition would be while (tempF != tempC), and the loop body would first decrement tempC and then recompute tempF.

But, outside of class you can be smarter. Suppose at t degrees C the F temperature is numarically the same. That means that:

t = 32 + (9/5)t

-32 = (4/5)t

t = (5/4)(-32) = -40

So -40 C is the same as -40 F. That's where your loop should stop if the integer conversion truncates toward 0 or rounds to the nearest.

( In Python, however, you'll stop at -39 unless you explicitly round the result. Python always truncates toward -infinity on float->int conversions.)

while C does not equal F

decrement temp C by 1

use resulting value to calculate F

if C == F the do this:

{ }

Rinse and repeat until done.

Your program should create two integer variables for temp in C and temp in F. Initialize the tempC to 100 degrees.

In a loop, decrement the C value and compare the corresponding temp in F until to values are the same...

I hve the varuables down. i just am confused on how to code the loop. since the variables are ints, the formula wont be exact thats ok. i just need help with the loop...