Computer Science, asked by nadeem3261, 3 months ago

If temperature is input through the keyboard in Fahrenheit degrees, write a program which determine how is the atmosphere according to the following rules:
if temperature is above 40 degrees centigrade------------------Very hot
if temperature is between 35 & 40 degrees centigrade--------Tolerable
if temperature is between 30 & 35 degrees centigrade--------Warm
if temperature is between 30 & 10 degrees centigrade--------Cool
if temperature is between 10 & 04 degrees centigrade--------Cold
if temperature is less than 04 degrees centigrade---------------Coldest

Answers

Answered by dreamrob
0

Program :

#include<iostream>

using namespace std;

int main()

{

int temp;

cout<<"Enter temperature in Fahrenheit : ";

cin>>temp;

if(temp > 40)

{

 cout<<"Very hot";

}

else if(temp <= 40 && temp > 35)

{

 cout<<"Tolerable";

}

else if(temp <= 35 && temp > 30)

{

 cout<<"Warm";

}

else if(temp <= 30 && temp > 10)

{

 cout<<"Cool";

}

else if(temp <= 10 && temp >= 4)

{

 cout<<"Cold";

}

else if(temp < 4)

{

 cout<<"Coldest";

}

}

Similar questions