write a program where the the computer will generate a numbe
write a program where the the computer will generate a number between 1 and 100 and then prompt the user to guess a random number between 1 and 100. After each guess the program will respond \"Too high\" or \"Too low\" until the user guesses the number.Please write in simple C++ code.
Solution
void main()
 {
 int number= rand() % 100 +1; //Generates number between 1 - 100
 int userNumber;
cout<<\"Please enter a number between 1 and 100\"<<endl;
 cin>>userNumber;
cout<<\"Do you wish to continue 1 for yes and 2 for n0\";
 cin>>choice;
do{
 if(userNumber==number)
 cout<<\"You guesses correct\"<<endl;
else if(userNumber>100)
 cout<<\"Your guess is too high\"<<endl;
else if(userNumber<0)
 cout<<\"Your guess is too low\"<<endl;
else if(30<userName<60)
 cout<<\"Your guess is near to the middle of range\"<,endl;
}while(choice==1 && userNumber!=Number);
 }
 }

