Question: Write a C console program that uses an infinite loop to play a number guessing game with the user. The program will need to generate

 Write a C console program that uses an infinite loop to
play a number guessing game with the user. The program will need

Write a C console program that uses an infinite loop to play a number guessing game with the user. The program will need to generate a random inteier berween 1 and 1000 This will be the secret number that the user is trying to guess. Use a counter variable to keep track of the number of guesses For more information on how to generate random integers in C+, see the following article: http://wwwdreamincode net/torums/topic/14057-producing random-numbers The program should enter into a while loop with a conditional value of true, whileltrue). The loop should be controlled from within the body. It should iterate until the correct number is guessed or until the user reaches some maximum number of allowed guesses inside the body of the loop, begin by prompting the user to guess an integer. Each time the user guesses an incorrect number, the program should respond by giving the user a hint of too high or too low.Once the correct number is guessed, use a break statement to exit the loop. Also break out of the loop if they reach the maximum number of allowed guesses After the loop finishes, display a success/failure message along with the number of guesses For Mimir The test cases look to see if two separate break statments are used, one for the max guesses and one for the user guessing the correct number

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!