cppreference.com > Other Standard C Functions > srand srand Syntax:
      #include <stdlib.h>
      void srand( unsigned seed );
The function srand() is used to seed the random sequence generated by rand(). For any given seed, rand() will generate a specific "random" sequence over and over again.
       srand( time(NULL) );
       for( i = 0; i < 10; i++ )
         printf( "Random number #%d: %d\n", i, rand() );
Related topics: rand (Standard C Date & Time) time