1.

Which header file is used to create the pseudo random generator?(a) random(b) cstdlib(c) rand(d) both random and cstdlibThis question was posed to me in an online quiz.My question is taken from Random Numbers topic in section Strings, Streams & Numerics in C++ of C++

Answer»

The correct answer is (d) both RANDOM and cstdlib

The explanation is: cstdlib header file is used to create PSEUDO random number. C++11 STANDARD added random header file as well to generate random NUMBERS.



Discussion

No Comment Found

Related InterviewSolutions