C Reference function rand() generate a random
number
This function of stdlib will generate a random number.
Usage of rand():
int rand (void);
Parameters:
The function rand() returns a pseudo-random integral number.
This number will be in the range 0 to RAND_MAX. The algorithm of rand() uses a seed to generate the series of numbers, this is why srand must be used to initialize the seed to some distinctive value.
The constant RAND_MAX is defined in standard library (stdlib).
The random numbers are delivered from a predetermined range.
Return value:
Will return an integer value between 0 and RAND_MAX.