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<br> Current is measured in units called
bixtya [17]

Answer:

current is measured in Ampere (A)

6 0
3 years ago
Read 2 more answers
 what can be done to prevent bridges from collapsing? ( give at least two examples)
ryzh [129]

Explanation:

the owner of the bridge and some workers

4 0
2 years ago
Heather is troubleshooting a computer at her worksite. She has interviewed the computer’s user and is currently trying to reprod
Luba_88 [7]

Answer:

The correct option is A

Explanation:

Heather is trying to establish a theory of probable cause. In this step of the troubleshooting process, the person troubleshooting questions the obvious and then test the theory or response given by the user to really determine the cause. Once confirmation of this theory has been achieved, the troubleshooter then tries to establish a resolution to the problem. However in the event whereby the theory is not confirmed, the troubleshooter then tries to establish a new theory.

8 0
4 years ago
Water is contained in a piston-cylinder assembly undergoes four processes separately, all started from an initial state where th
Andrews [41]

Answer:

see pictures

Explanation:

In the pictures you can see the different processes.

3 0
3 years ago
Mr. Blue lives in a blue house, Mrs. Pink lives in a pink house and Mr. Red lives in a red house. Who lives in the White House?
Cerrena [4.2K]

Answer:

the president and mr.white my history teacher lol

6 0
3 years ago
Other questions:
  • In C++ the declaration of floating point variables starts with the type name float or double, followed by the name of the variab
    14·1 answer
  • WHEN WAS THE FIRST CAR INVENTED?
    13·2 answers
  • You are traveling upstream on a river at dusk. You see a buoy with the number 5 and a flashing green light . What should you do?
    8·1 answer
  • This search compares the target value with the middle element in the collection, then ignores the half of the collection in whic
    11·1 answer
  • Guys i need help and some ones please help me
    12·1 answer
  • Mnsdcbjksdhkjhvdskjbvfdfkjbcv hjb dfkjbkjfvvfebjkhbvefgjdf
    7·2 answers
  • Writing an excellent problem statement will not help guide you through the rest of the process and steer you towards the BEST so
    8·1 answer
  • The cult of personality that surrounded Joseph Stalin in the Soviet Union led soviet citizens to believe that there was undisput
    10·1 answer
  • 1. A flywheel is suspended by resting the inside of the rim on a horizontal knife edge so that the wheel can swing in a vertical
    5·1 answer
  • Does anyone know what this is​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!