Question
Write a C program that guesses a number. The program should generate a random number from 10-100. The program then prints the following: A random
Write a C program that guesses a number. The program should generate a random number from 10-100. The program then prints the following:
A random number in the range has been generated by the program(Do not print the number). Can you guess what the number is? Please put in your first guess.
The player then types a first guess and the program will respond with one of the following options:
1. Excellent! You got it!
2. Too low (wrong). Try again.
3. Too high (wrong). Try again.
If the player's guess is incorrect, the program should loop until the player finally gets the number correct. The program should keep telling the player "too high" or "too low" to help the player "zero in" on the correct answer, The searching technique employed in the problem is called binary search.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started