Problem of the Day
Wednesday, September 23, 2026
Problem:
The formula for determining the temperature in degrees Fahrenheit based on a given temperature in degrees Celsius is

Which of the following instructions, given the double value C, correctly performs that calculation?
double F = 9 / 5 * C + 32;double F = 9.0 / 5 * (C + 32);double F = 9.0 / 5 * C + 32;double F = 9.0 / (5 * C) + 32;
The correct answer is c. Order of operations indicates that multiplying the fraction 9/5 times C occurs first, and then the addition. We need to be careful to use "floating point" division, as opposed to the integer division that will occur if we use the division operation with two integers (such as 9 and 5). Expressing one of those values as a double value solves the problem. Alternatively, you could just use 1.8 * C + 32 to avoid calculating the fraction altogether.