Question

Problem Write a C++program to 1- read a temperature, when entering a temperature from keyboard 2- print statement Below Freezing if a temperature is smaller than 32 3- And printAbove Freezing if a temperature is greater than 32.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student,

below i written the C++ code as per the requirement.

Please note the below program has been tested on ubuntu 16.04 system and compiled using g++ compiler. This code will also work on other IDE's

-----------------------------------------------------------------------------------------------------------------------------------

Program:

-----------------------------------------------------------------------------------------------------------------------------------

#include<iostream>

using namespace std;

int main()

{

int temp;

cout<<"Enter a temperature: ";

cin>>temp;

if(temp<32)

{

cout<<"Below Freezing"<<endl;

}

else

{

cout<<"Above Freezing"<<endl;

}

return 0;

}


==============================================================

Sample Output:

=================================================================

Kindly Check and Verify Thanks..!!!

Add a comment
Know the answer?
Add Answer to:
Problem Write a C++program to 1- read a temperature, when entering a temperature from keyboard 2-...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT