...

/

Play with Randomness

Play with Randomness

Use rand() and srand() to generate unpredictable behavior.

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() and srand() to generate random numbers. ...