Question: Before you even try to write these programs, make sure you can explain them in the form of psuedocode or in the form of a
Before you even try to write these programs, make sure you can explain them in the form of psuedocode or in the form of a flowchart.
5.35 (Guess the Number) Write a C program that plays the game of "Guess the number" as the following: Your program choose the number to be guessed by selecting an integer at random in the rang of 1 to 1000. The program then asks the use to guess the number. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program keeps telling the player "Too High" or "Too Low" to help the player "zero in" on the correct number. Keep the count of how many tries the user takes to get the correct number. Create a function that will accept the number of guess from the main program and based on the count display one of the following messages. If the number is 10 or fewer, "Either you know the secret or you got lucky." If the player guesses the number in 10 tries, display "You know the secret!" If the player makes more than 10 guesses, then display "You should be able to do better!" Think about why it should not take more than 10 guesses. With each "good guess" the player (you) should be able to eliminate half of the numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
