Question: Question 5 Write a guessing game where the user should guess a secret number, from 0 to X. After every guess the program tells the

Question 5 Write a guessing game where the user should guess a secret number, from 0 to X. After every guess the program tells the user whether their number was too large or too small until the user finds the right number. Write a function for your implementation, this function need to receive the maximum number to guess. In the end, this function must return the value found by the user, and present it in the main function. The number of tries needed should be printed - you can do this inside the function, return through the function or not, is up to you. Hint (you can use another way to have rand numbers -look for srand in cplusplus reference, you should initiate a seed for real random numbers) vl-randd) % 100; //vl in the range 0 to 99
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
