Play with Randomness
Use rand() and srand() to generate unpredictable behavior.
We'll cover the following...
Want a little surprise? In this lesson, you’ll learn how to use randomness in C++—to build games, roll dice, or create unpredictable programs.
Press + to interact
Goal
You’ll aim to:
Use
rand()
andsrand()
to generate random numbers. ...