time(NULL)
returns the time in seconds. If both calls to srand(time(NULL));
run within the same second, srand
gets the same value both times and initializes the random number generator to generate the same sequence of random numbers.
Just call srand
once at the start of the program and remove the other use and things should work as you expect.