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.h>
void main()
{
double temperature;
cout<<”Input Temperature :”;
cin>>temperature;
if (temperature<=80)
{cout<<”go swimming”;}
else if (temperature<=50)
{cout<<”go running”;}
else
{cout<<”stay inside”;}
}
#include <iostream>
using namespace std;
void main(){
double temperature;
cout<<"Input Temperature: ";
cin>>temperature;
if (temperature>=80){
cout<<"go swimming";
}else if (temperature>=50 && temperature<80){
cout<<"go running";
}else{
cout<<"stay inside";
}
cin>>temperature;
}
Comments
Leave a comment