We studied the rand() and srand(int) library functions. The function rand() returns pseudorandom numbers. What does pseudorandom mean? What is srand for?

a) Repeated calls to the rand() function returns a string of numbers that are mostly different but they aren’t random in any sense.
b) Pseudorandom numbers are things that resemble numbers but aren’t numbers.
c) In scientific use the word pseudo means resembling. A pseudorandom number sequence resemble random number sequence, but are not strictly random.
d) The function srand(arg) is a helper function for rand(). It must be called with the same argument, just before rand(), every time rand() is called.
e) The function srand(arg) is the seeding function for rand(). Each call to s srand(arg) with a different argument enables a sequence of calls to rand() to generate a different sequence of pseudorandom numbers.

c) In scientific use the word pseudo means resembling. A pseudorandom number sequence resemble random number sequence, but are not strictly random., and e) The function srand(arg) is the seeding function for rand(). Each call to s srand(arg) with a different argument enables a sequence of calls to rand() to generate a different sequence of pseudorandom numbers.

a) is a little bit flaky, but in my opinion it is wrong. b) is clearly wrong. Following d) will result in a sequence of all the same number.

Computer Science & Information Technology

You might also like to view...

The Navigation pane enables you to view a folder structure in a vertical list

Indicate whether the statement is true or false

Computer Science & Information Technology

All EXCEPT ________ is a type of reference for a cross-reference listing

A) Bookmark B) Figure C) Object D) Heading

Computer Science & Information Technology