76 339
Assignments Done
98,1%
Successfully Done
In May 2019

Answer to Question #47572 in C++ for krad

Question #47572
3. Write a program that examines the value of a variable call temp. then display the following messages, depending on the value assigned to temp.
Temperature Message
Less than 0 ICE
Between 0 and 100 WATER
Exceeds 100 STEAM
In Switch Case
Expert's answer
#include <iostream>
using namespace std;
int main() {
int temp;
cout << "Enter temperature: ";
cin >> temp;
if ( temp < 0 ) {
cout << "Less than 0 ICE"
<< endl;
return 0;
}
if ( temp < 100 ) {
cout << "Between 0 and 100 WATER"
<< endl;
} else {
cout << "Exceeds 100 STEAM"
<< endl;
}
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions