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
How would you design a wheelchair for wheelchair-using basketball players? Would you make it more or less massive?
emmainna [20.7K]
Less, if it’s too big: hard to control and maneuverability for shooting wouldn’t be that good. a smaller wheelchair allows for faster movement and control, along with easier shooting and upper body movement
6 0
3 years ago
The statement that is NOT true about the concept of a boundary layer on an object is: a. the Reynolds number is greater than uni
Ilya [14]

Answer:

Option E

Explanation:

All the given statements are true except the velocity gradients normal to the flow direction are small since these are not normally small. It's true that viscous effects are present only inside the boundary layer and the fluid velocity equals the free stream velocity at the edge of the boundary layer. Moreover, Reynolds number is greater than unity and the fluid velocity is zero at the surface of the object.

5 0
3 years ago
The privilege of driving comes with
julsineya [31]
The privilege of driving comes with responsibility
5 0
2 years ago
Technician A says the final drive assembly always has a gear ratio of 1:1. Technician B says the final drive assembly provides f
Olenka [21]

Answer:

Technician B only is correct

Explanation:

The last stage of gears found between the vehicle transmission system and the wheels is the final drive ratio. The function of the final drive gear assembly is to enable a gear reduction control stage to reduce the rotation per minute and increase the wheel torque, such that the vehicle performance can be adjusted and the final gear ratio can be between 3:1 and 4.5:1 not 1:1

Therefore, technician B only is correct

5 0
3 years ago
Water from the Earth's surface turns into a gas, or water vapor, when it is warmed and
bagirrra123 [75]

Answer:

Evaporation.

Explanation:

Evaporation is the stage of the Water Cycle where water turns into water vapor. The steps following Evaporation in order include Condensation, Precipitation, and Transpiration.

4 0
3 years ago
Read 2 more answers
Other questions:
  • A cylindrical specimen of this alloy 12.7 mm in diameter and 250 mm long is stressed in tension and found to elongate 7.6 mm. On
    5·1 answer
  • 1- A square-wave inverter has a dc source of 96 V and an output frequency of 60 Hz. The load is a series RL load with R = 5 Ohm
    7·1 answer
  • An Ideal gas is being heated in a circular duct as while flowing over an electric heater of 130 kW. The diameter of duct is 500
    11·1 answer
  • What does STP and NTP stands for in temperature measurement?
    15·1 answer
  • The truck travels in a circular path having a radius of 50 m at a speed of v = 4 m>s. For a short distance from s = 0, its sp
    11·1 answer
  • Why are Gas cars Bad?(cons) give me reasons why gasoline cars are bad<br><br>Thx if u help ​
    14·1 answer
  • HELP PLEASE!!!!
    12·1 answer
  • What form of joining uses heat to create coalescence of the materials?
    7·1 answer
  • The boost converter of Fig. 6-8 has parameter Vs 20 V, D 0.6, R 12.5 , L 10 H, C 40 F, and the switching frequency is 200 kHz. (
    12·1 answer
  • How can we love our country? Not by words but by deeds. - Jose P. Laurel
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!