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
3 MAOP stands for which of the following?
raketka [301]

Answer:

MAOP Master of Arts in Organizational Psychology (various universities)

MAOP Maximum Allowable Operating Pressure

MAOP Mid-Atlantic Association of Oracle Professionals

MAOP Mid Atlantic Oncology Program

MAOP Maryland Association of Osteopathic Physicians

MAOP Master Air Operations Planner

MAOP Meharry Association of Office Personnel

MAOP Managers' Annual Operating Plan

MAOP Military Assistance Officer Program (US DoD)

Explanation:

3 0
3 years ago
Primary mental skills needed for riding a motorcycle
Irina-Kira [14]

Answer:

You have to know the basic mechanics to help you correctly use the motorcycle, and you also have to have the right mindset - knowing you can ride it, and having determination. All of these factors are the primary mental skills you need for riding a motorcycle.

5 0
2 years ago
A heat engine is coupled with a dynamometer. The length of the load arm is 900 mm. The spring balance reading is 16. Applied wei
miss Akunina [59]

Answer:

P = 80.922 KW

Explanation:

Given data;

Length of load arm is 900 mm = 0.9 m

Spring balanced  read 16 N

Applied weight is 500 N

Rotational speed is 1774 rpm

we know that power is given as

P = T\times \omega

T Torque = (w -s) L = (500 - 16)0.9 = 435.6 Nm

\omega angular speed =\frac{2 \pi N}{60}

Therefore Power is

P =\frac{435.6 \time 2 \pi \times 1774}{60} = 80922.65  watt

P = 80.922 KW

4 0
3 years ago
An ideal gas undergoes two processes: one frictionless and the other not. In both the cases, the gas is initially at 200 ℉ and 1
Zarrin [17]

Answer:

The process which has friction

Explanation:

The entropy is simply the change in the state of the things or the molecules in the system. It is simply the change in the energy of the system with a focus on the atoms in the system. This is also known as the internal energy of the system and is given the symbol, G. The friction contributes to the change in the energy of the system. This is because friction generates another form of energy - that is heat energy. This energy causes the internal temperature id the system to increase. Hence the greater change in the temperature.

6 0
3 years ago
Read 2 more answers
What is 94*738^389428394
Lady_Fox [76]

Answer:

undefined

Explanation:

3 0
3 years ago
Other questions:
  • Select the material used to clean a prototype board before soldering.
    5·1 answer
  • A copper wire of original diameter .80 m exhibits a maximum tensile load/ strength at an engineering stress= 248.2 mpa. its duct
    11·1 answer
  • A shrinkage limit test is performed on a soil. The initial mass and volume of the soil are: V1=20.2cm^3 , while the final mass a
    15·1 answer
  • Use the orange points (square symbol) to plot the initial short-run industry supply curve when there are 20 firms in the market.
    5·1 answer
  • Refrigerant 134a enters a horizontal pipe operating at steady state at 40oC, 300 kPaand a velocity of 40 m/s. At the exit, the t
    13·1 answer
  • The line touching the circle at a point ....................... is known as ........................... .
    12·1 answer
  • Rosbel or Janette lol baakkaaa
    11·2 answers
  • Which of the following was a sustainable power source used during the Middle Ages?
    9·2 answers
  • What are the materials and tools used to build a headgear?​
    5·1 answer
  • PLEASE FIX THIS LUA SCRIPT
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!