Question: Write a simple guessing program that generates a random number between 1 and 7 and asks the user to guess the number. If the user

Write a simple guessing program that generates a random number between
1 and 7 and asks the user to guess the number. If the user guesses (input value) match
the programs random number. It prints Congratulations! You won else prints Sorry
Try again. Use a loop so that the user gets to play the game repeatedly. The program
terminates on entering any key by the user, except on (Y or y) key.
Example If the programs random number is 6 and the users guess number is 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!