Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Language%20in%20C%20Interview%20Questions%20and%20Answers

Question: What is the use of randomize( ) and srand( ) function?

Answer: While generating random numbers in a program, sometimes we require to control the series of numbers that random number generator creates. The process of assigning the random number generators starting number is called seeding the generator. The randomize( ) and srand( ) functions are used to seed the random number generators. The randomize( ) function uses PC's clock to produce a random seed, whereas the srand( ) function allows us to specify the random number generator's starting value.

Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook