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.
#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;
}
Comments
Leave a comment