I have a function generating random numbers. Why does it always generate the same ones? I tried running the algorithm several times but always get the same results.
#ifndef UTIL_H
#define UTIL_H
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
#define MIN 0
#define MAX 100000
void randomArray (double *array, int length)
{
    int i ;  
    for (i = 0; i < length; i++) 
    {
        array[i] = (double) (rand () /
                   (((double) RAND_MAX + 1) / (double) (MAX - MIN + 1))) + MIN;
    }
}
int main(void) 
{
    int i;
    double test_array[9];
    randomArray(test_array,  9);    
    for(i = 0; i < 9; i++)
        printf("%f ", test_array[i]);
    printf("\n");
    return 0;
}
 
     
     
    