+ 13
What is rand function?
how does it work?
6 Respuestas
+ 14
rand function generates a random number .
rand()%10 gives any random number between 0 and 9. But repeating the same code generates the same number
+ 3
rand function generate pseudo-random numbers.
+ 3
rand function returns a random number between 0 and RAND_MAX.
+ 1
It is a way to produce random numbers.
+ 1
Google it. there are plenty of examples out there.
+ 1
This function allows you to automatically generate random numbers for your application. For instance, in a game where you have to roll a dice, you could use this function to randomly generate a number between 1 to 6 EACH time the dice is rolled by your user.