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".
#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;
}
Comments
Leave a comment