Question: Answer in C++ please COMP160 Guessing Game Write a program that asks the user to guess a number. The program should get a random number
COMP160 Guessing Game Write a program that asks the user to guess a number. The program should get a random number and count the number of times it takes the user to guess it. An easy way to get a random number is to use the randO function. You must \#include st hlib,h for this function. Before calling rand0, you will want to seed the random number generator. Otherwise it always makes the same random numbers. To create a random number from 1 to 100 srand(time(NULL)); 1/ seed the random number generator int target =rand() \& 100+1;// number to be guessed The program should continue to ask the user for a guess until they enter the correct number. If the guess is less than the target, display "Too low" and display "Too high" if the guess is larger than the target. Output from the program might look like the following (although your numbers will be different)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
