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".


Expert's answer

#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!

LATEST TUTORIALS
APPROVED BY CLIENTS