Question: question 1 Suppose you are writing a program that will use the C/C++ random number generator. Show the #include statements that are necessary for your

question 1

Suppose you are writing a program that will use the C/C++ random number generator.

Show the #include statements that are necessary for your program.

Show the code you would use to initialize (or "seed") the random number generator. (Show only the statement or statements necessary that you would include in your main function.)

question 2

Suppose you have three int variables declared as follows:

int x, y, z;

Write the code necessary to do the following:

Assign a random number to x.

Assign a random one-digit number (value in range 0 to 9) to y;

Assign a random two-digit number (value in range 10 to 99) to z;

You may assume that the random number generator has been properly initialized. Give only three assignment statements

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!