I am currently working on the variable section of in the C++ course. The exercise on which it asks me to ask user what the temperature is using cin. I used the formula that they gave me to find degrees in Celsius, C = (F-32)/1.8.

I did the following code:

#include

int main() {

double tempf;

double tempc;

tempc = (tempf - 32)

/ 1.8;

std::cout << "Enter the temperature in Fahrenheit: ";

std::cin >> tempf;

std::cout << “The temperature is " << tempc << " degrees Celsius.\n”;

}

For some reason, when I put 83, which was the value that they had assigned me on the previous exercise. (I used it as an example to see if I would get the same results), I get -17.77778 Degrees Celsius. It turns out that this answer would appear for any value that I put for degrees Fahrenheit. Please help. Thanks.