Machine-translated by Google. Questions are authored in English.
Top

Discussion

What will the function randomize() do in Turbo C under DOS?

  • A.returns a random number
  • B.returns a random number generator in the specified range
  • C.returns a random number generator with a random value based on time
  • D.return a random number with a given seed value

Answer: C

Correct answer: returns a random number generator with a random value based on time

randomize() seeds the random number generator from the system clock, so that a program produces a different sequence on each run. Without it, rand() starts from the same seed every time and repeats the same numbers - which is convenient for debugging and useless for a game.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.