- #1
nukeman
- 655
- 0
Homework Statement
Its a simple temp conversion program.
NOW, my problem is when ever I enter a temperature to convert, it just keeps repeating NON stop until i hit ctr-C - Here is the code below. What am i missing and how do i fix this little error?
Code:
/ This program ...This program converts temperatures from Fahrenheit to Celsius.
#include <iostream>
using namespace std;
int main()
{
const int SENTINEL_VALUE = -99;
int degree;
double conversion;
cout << " This proram converts temperatures from Fahrenheit to Celsius.";
cout << " Enter the temperature to convert (-99 to quit): ";
cin >> degree;
while ( degree != SENTINEL_VALUE )
{
conversion = (degree - 32) * 5.0/9 + 0;
cout << degree << " degrees farhenheit is " << conversion << " degrees celcius " << endl;
cout << " " << endl;
cout << " This proram converts temperatures from Fahrenheit to Celsius.";
cout << " Enter the temperature to convert (-99 to quit): ";
cin >> degree;
}
cout << "\nNormal program exit\n";
return 0;
}