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 

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

1 Expert Approved Answer
Step: 1 Unlock

Here is a simple C program that fulfills the requirements youve described include include include in... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!