for(i = 0; i < n; i++){ srand(time(NULL)); printf(\"%d \", time(NULL)); for(j = 0; j < (n-1); j++){ a[i][j] = rand();
Don't call srand() every time through the loop - just do it once beforehand.
srand()