Question: answer using c++ Description: Write a program which displays a number between 10 to 100 randomly. The randomly selected number is : 34 The randomly

answer using c++  answer using c++ Description: Write a program which displays a number

Description: Write a program which displays a number between 10 to 100 randomly. The randomly selected number is : 34 The randomly selected number is : 45 The randomly selected number is : 76 Hint: Use cstdlib and ctime library functions like rand(), e.g. 1. srand(time(0)); // First, "Seed" the random generator - srand() gives the random function a new seed, a starting point (usually random numbers are calculated by taking the previous number (or the seed) and then do many operations on that number to generate the next). - time (0) gives the time in seconds since the Unix epoch (the Unix epoch = 1 January 1970 00:00:00. time(0) returns the amount of seconds that have passed since that moment) which is a pretty good "unpredictable" seed (you're guaranteed your seed will be the same only. once, unless you start your program multiple times within the same second). - Thus its better than using (time(NULL)), which is likely to return the same "random" numbers always within a second. 2. rand 0%91+10;// Randomly generate integer between 10 and 100

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!