when I run this program no matter what temperature I enter, the output is my first cout statement.
Could anyone tell me what i must change for the code to work??
#include <iostream>
using namespace std;
int main ()
{
double temp;
cout << "Please enter a temperature " << endl;
cin >> temp;
if (temp = -173)
cout << "ethyl alcohol freezes at that temperature" << endl;
else if (temp = 172)
cout << "ethyl alcohol boils at that temperature " << endl;
else if (temp = -38)
cout << "Mercury freezes at that temperature " << endl;
else if (temp = 676)
cout << "Mercury boils at that temperature " << endl;
else if (temp = -362)
cout << "Oxygen freezes at that temperature " << endl;
else if (temp = 306)
cout << "Oxygen boils at that temperature " << endl;
else if (temp = 32)
cout << "Water freezes at that temperature " << endl;
else if (temp = 212)
cout << "Water boils at that temperature " << endl;
else
cout << "No information found for the temperature you entered"<< endl;
return 0;
}