hey guys,
I want to create 6 different random numbers without repetitions and this what I have done. I just wanted to make sure if this logic makes sense.
for(int n=0 ; n<6 ; n++)
{
randomInt[n] = generateRandomInt(0,20);
cout << randomInt[n] << endl;
}
for(int i=0 ; i<6; i++)
{
for(int j=i+1 ; j<6 ; j++)
{
if(randomInt[i] == randomInt[j])
randomInt[i]=generateRandomInt(0,20);
}
cout << randomInt[i] << endl;
}
}