Created
June 17, 2016 06:57
-
-
Save olzaragoza/22e692191e3b4bad2a19690fd6383928 to your computer and use it in GitHub Desktop.
C++ rand() function usage examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
random1 = rand() % 10; // range 0 to 9 | |
random2 = rand() % 100 + 1; // range 1 to 100 | |
random3 = rand() % 22 + 1999; // range 1999-2019 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment