Answer to Question #329175 in C++ for arif

Question #329175

Program that receives the current temperature as input. If the temperature is 80 degrees or more, output a message telling the user to go swimming, otherwise, if the temperature is 50 degrees or more, output a message to go running, otherwise stay inside.


1
Expert's answer
2022-04-15T16:34:28-0400
#include <iostream>
using namespace std;


int main() {
    int temperature;


    cout << "Enter a temperature: ";
    cin >> temperature;


    if (temperature >= 90) {
        cout <<"Go swimming" << endl;
    }
    else if (temperature >= 50) {
        cout << "Go running" << endl;
    }
    else {
        cout << "Stay inside" << 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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS