how to generate random numbers without using rand() function?

I wanted to know if there is some way of generating pseudo random integers without using rand() function giving lesser number of collisions.

Various pseudo-random number generators are available, but rand() is likely to use a good one. See for example https://en.wikipedia.org/wiki/Middle-square_method#Middle_Square_Weyl_Sequence_PRNG

1 Like