Question: Part B: C Programming Exercise ( 5 marks ) a ) Write a C program that generates a random number between 0 and 5 0
Part B: C Programming Exercise marks
a Write a C program that generates a random number between and Then, the program prompts for guesses until the user is correct, or has made wrong guesses. After each guess, the program indicates whether the guess was too high, too low, or correct. Once the round has ended, either by a correct guess or by using up the guesses, the program displays the current status.
b Save your program to a file named "guessGame.c in the working directory on the PC you are using.
c Demonstrate the guessGame.c file to GATAs and run with different input values.
Hint: To generate a random number between and in C first, add #include to your code and then use the following statement:
text int goal text rand ;
Assuming the random number is a sample interaction is shown below
Enter your guess between and : mathbf
Too low
Enter your guess between and : mathbf
Too high
Enter your guess between and :
Correct, the number was
If the user entered more than wrong guesses:
Sorry, the number was
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
