1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Over [174]
3 years ago
5

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to

print two random integers between (and including) 0 and 9. End with a newline. Ex: 5 7 Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)

Engineering
1 answer:
liq [111]3 years ago
4 0

Answer:

View Image

Explanation:

No number is really ever random. It all has a seed, which is an initial value for the 'random' number to be generated. The rand() function uses an equation to  generate its value, and all its 'random' value depend on the first number you plug in into your equation. The initial number you plug into your equation is what srand() do.

If you just call rand() alone without calling srand() then the generated numbers will automatically use srand(1) as a default seed. Using the same srand() value will always yield the same sequence of numbers.

To get a number between 0 and 9, take the modulus of it with 10 because modulus give you the remainder, so the number rand()%10 will never be equal to 10 or greater.

You might be interested in
A cylindrical 1045 steel bar is subjected to repeated compression-tension stress cycling along its axis. If the load amplitude i
Gre4nikov [31]

Answer:

13.4 mm

Explanation:

Given data :

Load amplitude ( F )  = 22,000 N

factor of safety ( N )= 2.0

Take ( Fatigue limit stress amplitude for this alloy ) б = 310 MPa

<u>calculate the minimum allowable bar diameter to ensure that fatigue failure will not occur</u>

minimum allowable bar diameter = 13.4 * 10^-3 m ≈ 13.4 mm

<em>attached below is a detailed solution</em>

3 0
2 years ago
A horizontal channel of height H has two fluids of different viscosities and densities flowing because of a pressure gradient dp
cricket20 [7]

Answer:

Given that;

Jello there, see explanstion for step by step solving.

A horizontal channel of height H has two fluids of different viscosities and densities flowing because of a pressure gradient dp/dx1. Find the velocity profiles of two fluids if the height of the flat interface is ha.

Explanation:

A horizontal channel of height H has two fluids of different viscosities and densities flowing because of a pressure gradient dp/dx1. Find the velocity profiles of two fluids if the height of the flat interface is ha.

See attachment for more clearity

6 0
3 years ago
Which is a reason that teen might choose to focus on a friendship and not a romantic relationship
andrey2020 [161]

Answer: b. To avoid having distractions

Trust me it’s definitely option b

4 0
3 years ago
Read 2 more answers
Argue the importance to society of incorporating green building into an engineer's designs, with at least two examples.
stellarik [79]

Answer:

Green Design is your answer

Explanation:

4 0
2 years ago
Read 2 more answers
28. List the 3 basic parts of a lamp?
bekas [8.4K]

Answer:

cord light bulb

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • A converging-diverging nozzle is designed to operate with an exit Mach number of 1.75 . The nozzle is supplied from an air reser
    15·1 answer
  • According to Manor, the example of the subway train in New York City is an example of which type of uniqueness?
    9·1 answer
  • If link AB of the four-bar linkage has a constant counterclockwise angular velocity of 58 rad/s during an interval which include
    11·1 answer
  • Block A has a weight of 8 lb. and block B has a weight of 6 lb. They rest on a surface for which the coefficient of kinetic fric
    8·1 answer
  • Which of the following is not an example of heat generation? a)- Exothermic chemical reaction in a solid b)- Endothermic Chemica
    15·1 answer
  • Please explain the theory of Hydrostatic Thrust on a plane Surface
    14·2 answers
  • The two boxcars A and B have a weight of 20000lb and 30000lb respectively. If they coast freely down the incline when the brakes
    11·1 answer
  • 3. How can statistical analysis of a dataset inform a design process?<br> PLEASE I NEED THIS ANSWER
    8·1 answer
  • How can you drop two eggs the feweHow can you drop two eggs the fewest amount of times, without them breaking? ...st amount of t
    13·2 answers
  • Hello how are you all bye everyone have a great day ahead​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!