Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++ image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Were they made on a timely basis?

Answered: 1 week ago

Question

Did the decisions need to be made, or had they already been made?

Answered: 1 week ago