SOLUTION TO THE ABOVE QUESTION
SOLUTION CODE
#include <iostream>
using namespace std;
int main() {
cout<<"\nEnter your guess: ";
int guess;
cin>>guess;
if(guess>= 50)
{
cout<<"\nThe guess is very high."<<endl;
}
else if(guess>=30)
{
cout<<"\nThe guess is high."<<endl;
}
else if(guess>=15 && guess < 30)
{
cout<<"The guess is moderately high."<<endl;
}
else if(guess >= 0 && guess < 15)
{
cout<<"\nThe guess is somewhat low"<<endl;
}
else
{
cout<<"The guess is a negative number"<<endl;
}
return 0;
}
Comments
Leave a comment