C++

Random Number Generator (rand & srand) In C++

C++ code for binary search using random number generator and clock

Random Number Generator (rand & srand) In C++
Random Number Generator (rand & srand) In C++

srand : This function sets the starting point for producing a series of pseudo-random integers. If srand() is not called, the rand() seed is set as if srand(1) were called at program start. Any other value for seed sets the generator to a different starting point.




rand: This number is generated by an algorithm that returns a sequence of apparently non-related numbers each time it is called. This algorithm uses a seed to generate the series, which should be initialized to some distinctive value using function srand.

Leave a Comment