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
Alchen [17]
3 years ago
6

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 newline. Ex:
5
7
Computers and Technology
1 answer:
jek_recluse [69]3 years ago
5 0

Answer:

The solution code is written in C language.

  1.    srand(seedVal);
  2.    printf(" %d \n", rand() % 9);
  3.    printf(" %d \n", rand() % 9);

Explanation:

srand() is a C library function which seeds the random number generator. The srand() function will take one unsigned integer, <em>seedVal</em>, as input parameter (Line 1).

We can print random integer between (and including) 0 and 9 by calculating the random number modulus by 9 (Line 2-3). This will ensure the final random number will also be between 0 and 9.

You might be interested in
What part of a resource record tells a server how long the record should remain in the cache?
V125BC [204]
Time-to-live or TTL <span>tells a server how long the record should remain in the cache.
TTL is a mechanism that limits the lifetime of data in a network or a computer and prevents data packets from circulating indefinitely.
</span><span>It also improves the caching and privacy of networks and computers.</span>
8 0
4 years ago
I need help quick Which of the following principles is not part of the constitution?
laila [671]

Answer:

Confederalism is not in the constitution it was adopted later.

Explanation:

5 0
3 years ago
Consider a hard disk with the following specifications :<br> 3.5 in diameter
AnnyKZ [126]

Answer:

usable capacity = 10 GB

Number of cylinders = 256

Block size = 4 KB

(1)Bytes in each cylinder = (10*230)/(256) = (10*222) = 40 MegaBytes

(2)Number of Blocks in each cylinder = (10*222)/(212) = 10K

(3)capacity of one track = 40 MegaBytes/(10*2) = 2 MB

Rotation speed = 3840 RPM

Number of rotations per second = 3840/60 = 64

Transfer rate = (2*64) = 128 MB/sec

Explanation:

6 0
3 years ago
Carlos had 194 seeds and 11 flower pots he put the same number of seeds in each flower pot which is the best estimate for the nu
Inessa [10]

Answer:

20?

Explanation:

4 0
3 years ago
If you increase or decrease the font size of one shape, the font size in other shapes will not be affected. True False
const2013 [10]
When you change the size of an individual shape in a SmartArt graphic, the remaining shapes may adjust their sizes and positions, depending upon the layout of your SmartArt graphic and the amount of available space. In some cases, only the individual shape that you resize will change. In others cases, corresponding shapes will change their size as well.
8 0
3 years ago
Other questions:
  • What element of a timeline helps to mark progress of the project?
    15·1 answer
  • According to social penetration theory, the __________ dimension concerns the number of topics disclosed whereas the __________
    6·1 answer
  • What is the difference between a switch and a hub?
    8·1 answer
  • How is communication within healthcare different than communication within other industries ?
    13·1 answer
  • Question #5
    15·2 answers
  • How are actual rocket launches similar to how balloon rockets and canister rockets launch?
    6·1 answer
  • Sustainable development is a goal towards which all human societies need to be moving. elaborate the statement in about 120 word
    9·1 answer
  • A(n) _____ exists when there are functional dependencies such that XY is functionally dependent on WZ, X is functionally depende
    14·2 answers
  • 6.- Escribe un ejemplo donde se utilice un sistema de información
    12·1 answer
  • Part of an algorithm which is repeated for fixed number of times is classified as.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!