Write a program in which the user is supposed to guess the number hidden in
the code. ( this will be an integer variable called “guess” and can be initialized
to any value between 0 and 100). If the number entered by the user is larger
than the hidden number, you should print, “You should try smaller values”.
Likewise if the number entered by the user is smaller than the hidden number,
you should print “You should try larger values”. If user enters the correct
number, you should print “Congratulations !!!” and exit the program. You
should print “Invalid, guess should be between 0 and 100” for guesses other
than [0-100]
int main(){
int grade=0;
while (grade!=-1){
cout<<"Enter student grade: ";
cin>>grade;
if((grade>=91)&&(grade<=100))
cout<<"Letter grade is A"<<endl;
if((grade>=81)&&(grade<=90))
cout<<"Letter grade is B"<<endl;
if((grade>=71)&&(grade<=80))
cout<<"Letter grade is C"<<endl;
if((grade>=61)&&(grade<=70))
cout<<"Letter grade is D"<<endl;
if((grade>=0)&&(grade<=60))
cout<<"Letter grade is F"<<endl;
}
cout<<"Thanks for using my program.";
return 0;
}