Question: Sample Output: Guess the number ( between 1 and 1 0 ) . You have 3 attempts. Enter your guess: 8 Too high! Try again.
Sample Output:
Guess the number between and You have attempts.
Enter your guess:
Too high! Try again.
Enter your guess:
Too low! Try again.
Enter your guess:
Congratulations! You guessed the number.
Guess the number between and You have attempts.
Enter your guess:
Too low! Try again.
Enter your guess:
Too low! Try again.
Enter your guess:
Too low! Try again.
Sorry, you've used all your attempts. The number was: Grading Criteria:
Grading Criteria
Program executes and achieves desired output: points
Calculation errors: points each
Compilation errors: to points based on severity
Lack of indentation or poor formatting: points
Input handling errors: pointsLab : Number Guessing Game with Functions, Loops, and Conditionals
Instructions:
In this lab, you will develop a numberguessing game. The game will use functions to
organize the code, loops to allow the user multiple attempts, and conditional statements
to provide feedback. The user will have chances to guess a randomly generated number
between and File should be named Labc
Goals:
By the end of this lab, you should be able to:
Write and call functions in C to organize your code.
Use loops to repeat tasks eg asking the user to guess
Use conditional statements if else if else to provide feedback based on user input.
Generate a random number using the C standard library.
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
