Temperature Program

How would you be able to show both outputs celsius and Fahrenheit and my temperature conversion is coming up wrong when i enter in the input.

here is my code...


#include<iostream>
using namespace std;
int main(){
double celsius;
double fahrenheit;


while(true){

cout << "Please enter in a fahrenheit temperature ";
cin >> fahrenheit;

celsius= fahrenheit * 5/9 - 32;
cout<< "celsius="<< celsius <<endl;

}
system("pause");
return 0;
{

cout << "Please enter in a celsius temperature ";
cin >> celsius;
fahrenheit = celsius * 9/5 + 32;
cout <<"fahrenheit= " << fahrenheit << endl;
}
system("pause");
return 0;

}
The formula for celsius -> (fahrenheit - 32) * 5/9

How would you be able to show both outputs celsius and Fahrenheit
Remove the first
1
2
3
4
}
system("pause");
return 0;
{
Topic archived. No new replies allowed.