1.

What is the purpose of using function srand()?(a) to set the seed of rand() function(b) to generate random numbers(c) to enable rand() function(d) to improve efficiency of rand()I got this question in an online interview.The query is from Number Theory in division Number Theory of Data Structures & Algorithms II

Answer»

Correct answer is (a) to SET the SEED of RAND() function

Easiest EXPLANATION - The function srand() sets the seed of rand(). It can be used to GENERATE a unique set of random numbers every time.



Discussion

No Comment Found

Related InterviewSolutions