Answer to Question #345280 in C++ for Ali

Question #345280

Looping problem:-

Write an if-else statement that outputs the word "Warning" provided that either the value of the variable temperature is greater than or equal to 100, or the value of the variable pressure is greater than or equal to 200, or both. Otherwise, the if-else statement outputs the work "OK".


1
Expert's answer
2022-05-30T08:15:13-0400
#include <iostream>
using namespace std;
int main() {
    float temperature, pressure;
    cout<<"Enter temperature: ";
    cin>>temperature;
    cout<<"Enter preasure: ";
    cin>>pressure;
    if(temperature>=100||pressure>=200)
        cout<<"Warning!"<<endl;
    else
        cout<<"OK"<<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
APPROVED BY CLIENTS