#include <stdlib.h>
int rand(void);
rand() generates a pseudo random number in the range from 0 to RAND_MAX. The numbers generated are based on a seed, which initially is 1. To change the seed, use srand().
The same seeds always lead to the same sequence of pseudo random numbers.
A pseudo random integer in the range from 0 to RAND_MAX.