+ 2

Usage of random,srand ,rand,randomise

Can anyone please give examples to make me understand how to use random,rand,srand,randomise

5th Jan 2019, 8:40 AM
Subharthi Paul
2 Answers
+ 2
Thank you
5th Jan 2019, 10:14 AM
Subharthi Paul
0
srand = only once per program : initialize Ex : srand(time(0)); Rand = return random number Ex : rand()%10; //random numbers between 0 and 9
5th Jan 2019, 8:55 AM
Théophile
Théophile - avatar