rand()

Syntax
  #include <stdlib.h>

  
  int rand(void);

  
Description

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.

Return

A pseudo random integer in the range from 0 to RAND_MAX.