Question: In C Language please: Create a C Language code of a guessing game. The game consists of guessing a randomly generated number from the range

In C Language please:

Create a C Language code of a guessing game. The game consists of guessing a randomly generated number from the range 1 through 20. The program should begin by asking the user if they would like to play, the user then should enter 1 for yes or 0 for no. If the user enters 0 then the program should end and display a text saying that the user has chosen to quit, if the user enters 1 then the program continues. The user is given 5 attempts at guessing the number that the computer randomly generated. After each user input, the program should tell the user if the number inputted is larger than, smaller than, or equal to the randomly generated number. If the user manages to guess the correct number then no other guesses should be made and the program should end by telling the user that they won. If the user fails to guess the right number after 5 attempts then the program should notify the user that they lost.

Objectives:

Use of functions and passing by value and reference.

Use of selection constructs (if/else).

Use of defined constants.

The use of the random number generator and seeding.

Display formatted output using input/output statements.

Use format control strings to format text output.

Below are pictures of the expected program:

In C Language please: Create a C Language code of a guessinggame. The game consists of guessing a randomly generated number from the

Example of not wanting to play: Do you want to play a random number guessing name? Enter in a 'l' for yes and a 'O' for no: 0 You did not want to play or entered an invalid choice. Example of playing and winning: Do you want to play a random number guessing game? Enter in a 'l' for yes and a 'O' for no: y The number is from 1 to 20. Can you guess what it is? 1 Your guess of 1 is too low. Can you guess what it is? 19 Your guess of 19 is too high. Can you guess what it is? 5 Congrats, you won

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!