rand

rand

Defined in header <stdlib.h>
int rand();

Returns a pseudo-random integer value between ​0​ and RAND_MAX (0 and RAND_MAX included).

srand() seeds the pseudo-random number generator used by rand(). If rand() is used before any calls to srand(), rand() behaves as if it was seeded with srand(1). Each time rand() is seeded with srand(), it must produce the same sequence of va