srand() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

srand()

How to write and use srand() in a specific time period between ( 1 second to 3 seconds )

4th May 2020, 1:14 AM
Oday S Manasrah
Oday S Manasrah - avatar
2 Answers
+ 5
srand(time(0)); int rn = rand() % 3 + 1;
4th May 2020, 1:29 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
4th May 2020, 4:31 PM
SAN
SAN - avatar