Question: Write a program that generates a random number between 1 and 1 0 and asks the user to guess it . It then reads the

Write a program that generates a random number between 1 and 10 and asks the user to guess it. It then reads the user's guess. If it's not the one generated, the program tells the user that the number is odd or even and that the guess was too low or too high. After the second try, the program tells again if it's too low or too high and that it's divisible by 3 or not. After the 3rd try, if the user still hasn't got it, the program tells what the number was. If anytime the user guesses it correctly, the program responds with "Right". Example: Guess the number generated between 1 and 10: 5 The number is even. Your guess is too low. Guess the number: 8 The number is divisible by 3 Your guess is too high. Guess the number: 6 Right

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 Programming Questions!