Question: Write a C++ program that generates a random number between 1 and 200. The program will keep asking the user to input a number
Write a C++ program that generates a random number between 1 and 200. The program will keep asking the user to input a number and display corresponding message based on the input, telling the user if the guess is bigger or smaller than the generated number or out of range. If the user enters the correct answer, the program will display a message showing how many guesses have been made and exit (if the guess is out of range, it does not count as one guess). Here is a sample run: A number is generated, make a guess: 68 Your guess is too big, make a guess: 20 Your guess is too small, make a guess: 202 Your guess is out of range, make a guess: 44 You got it right! It took 3 times to get the correct answer.
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
Here is a simple C program that fulfills the requirements youve described include include include in... View full answer
Get step-by-step solutions from verified subject matter experts
