# Random Number | Learn CPlusPlus

In C++, the "rand()" function generates pseudo-random numbers between 0 and RAND\_MAX. To ensure different sequences, "srand()" initializes the random number generator with a seed. However, C++11 introduces &lt;random&gt; library, providing better randomness and more control. It offers various distributions like uniform, normal, and discrete. Developers should prefer &lt;random&gt; over rand() for modern C++ programming. If you want to explore more about [Random Number](https://learncplusplus.org/what-are-the-differences-between-stdrand-and-stdmt19937-in-modern-c/), take a look at this blog.
