Lab 2 Write a program that asks the user to guess a random number between 1 and 100. Notes: • The program should tell th

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Lab 2 Write a program that asks the user to guess a random number between 1 and 100. Notes: • The program should tell th

Post by answerhappygod »

Lab 2 Write A Program That Asks The User To Guess A Random Number Between 1 And 100 Notes The Program Should Tell Th 1
Lab 2 Write A Program That Asks The User To Guess A Random Number Between 1 And 100 Notes The Program Should Tell Th 1 (57.12 KiB) Viewed 25 times
Lab 2 Write a program that asks the user to guess a random number between 1 and 100. Notes: • The program should tell the user if their guess is too high or too low. • The program should continue to allow the user to guess the number until the user guesses the random number. • The program should keep track of how many tries did it take for the user to guess the random number. • Once the user guesses the random number, the program should ask the user if they would like to play again. If the user wants to play another game, then the program should generate a new random number for user to guess. • The program should keep track of how many games did the user play. • To generate a random number in C++, use the following code: // time; #include <time.h> #include <stdlib.h> srand, rand srand (time (NULL)); //initialize random seed num= rand() % 100 + 1; //generates a number between 1. and 100
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply