Question: In C Language Write a program that accepts two inputted integers from the user: a minimum value, and a maximum value. The inputted numbers should

In C Language

Write a program that accepts two inputted integers from the user: a minimum value, and a maximum value. The inputted numbers should be accepted at the same time.

For example:

Enter a min, followed by a max number, separated by a space: 2 500

Ensure both inputted numbers are greater than 0. If they are not, print and error an exit your program early.

Ensure the max number is greater than your min number by at least 30, otherwise, print an error and exit your program early.

Ensure the max number is not greater than your min number by more than 1000, otherwise, print an error and exit your program early.

Generate a random integer number between the min value, and the max value. Note this random number should be different every time you run your program (even with the same input).

Ask your user to input an integer number between the inputted min and max numbers (they will be trying to guess the random number).

If they guess the number correctly, print Winner and quit.

If the guess is less than the random number 20 or more, print A lot higher

If the guess is less than the random number by 10 or more and less than 20, print Higher

If the guess is less than the random number by less than 10, print A little higher

If the guess is more than the random number by 20 or more, print A lot lower

If the guess is more than the random number by 10 or more and less than 20, print Lower

If the guess is more than the random number by less than 10, print A little lower

Continue to prompt the user for a new guess, and print the appropriate messages until the correct number is chosen. If the user inputs -1 as their guess, print Quitter and quit.

In C

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!