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
Why does the auto industry prefer uniform (national) standards for automobile emissions as opposed to regionally varying standar
WINSTONCH [101]

Answer:

Explanation:

For automobile emission, a uniform standard is preferred, because no unnecessary advantage is given by it to any company that is located in particular states where the regional standards are less severe.

Since pollution has its impact across the states and in the whole of the USA, then there should be uniform standards across all the states. It will also invalidate the impact of regional standards as a factor in the selection of plant locations for the automobile company. It means that a state offering less valid emission standards, will attract more companies to herself and it will be against the other states who care more about the natural environment. It can make more states to opt for the permissive emission standards, that will be more harmful to the USA as a country, than the good. So, a uniform standard is preferred to eliminate it as a factor in plant location decisions.

Yes, uniform standards are beneficial to everyone, because it will bring effective control upon the pollution level because there will be no state where the culprit firm can hide. Besides, it is more effective as efforts done towards environment conservation.

3 0
3 years ago
In which situation is a are food service workers not required to wash their hands?
Margarita [4]

Answer:

when wearing gloves?

Explanation:

?

or when off duty

3 0
3 years ago
Read 2 more answers
How to study thermodynamics?​
expeople1 [14]

It is study of the relationships between heat, temprature, work and energy

7 0
3 years ago
Read 2 more answers
Regeneration can only increase the efficiency of a Brayton cycle when working fluid leaving the turbine is hotter than the worki
storchak [24]

Answer:

True, <em>Regeneration is the only process where increases the efficiency of a Brayton cycle when working fluid leaving the turbine is hotter than working fluid leaving the compressor</em>.

Option: A

<u>Explanation: </u>

To increase the efficiency of brayton cycle there are three ways which includes inter-cooling, reheating and regeneration. <em>Regeneration</em> technique <em>is used when a turbine exhaust fluids have higher temperature than the working fluid leaving the compressor of the turbine. </em>

<em>Thermal efficiency</em> of a turbine is increased as <em>the exhaust fluid having higher temperatures are used in heat exchanger where the fluids from the compressor enters and increases the temperature of the fluids leaving the compressor. </em>

6 0
3 years ago
Read 2 more answers
Una empresa realizó en el ejercicio de compras al contado por valor
Tanzania [10]

Answer:

englishhhh pleasee

Explanation:

we dont understand sorry....

8 0
3 years ago
Other questions:
  • The button on the _ valve should be held when pressure bleeding the brakes
    8·1 answer
  • Extra Credit: The Linc (parking lot and stadium)In celebration of the upcoming Super Bowl, for a maximum 10 points of extra cred
    7·1 answer
  • The difference in quantity between the add and full marks on an engine oil dipstick is typically
    5·1 answer
  • un contenedor de 0.01m∧3 se llena con 2kg de nitrogeno a una presion de 15mpa ¿cual es la temperatura del nitrogeno?resolver uti
    8·1 answer
  • To provide some perspective on the dimensions of atomic defects, consider a metal specimen that has a dislocation density of 105
    6·1 answer
  • A 60-Hz 3-phase induction motor is required to drive a load at approximately 850 rpm. How many poles should the motor have
    9·1 answer
  • A golfer and her caddy see lightning nearby. the golfer is about to take his shot with a metal club, while her caddy is holding
    12·1 answer
  • 25 In differential aeration corrosion, rich oxygenated parts are
    14·1 answer
  • What is the name of the type of rocker arm stud that does not require a valve adjustment?
    12·1 answer
  • In a series circuit, resistance is the simple _____ of all resistors in the circuit.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!