codice:
random = rand() % (righe +1);
perchè righe+1? il tuo numero deve essere da 0 a 99 perchè questo è il range di elementi dell'array quindi:

codice:
random = rand() % (righe);
inoltre così:

if(random2 == random);
random2 = rand() % (righe);

non è detto che random2 si diverso da random meglio un

do{
random2 = rand() % (righe);
}while(random2==random);