Hey, I'm just wanting to know how i can make some code so no random numbers are the same, I've got this so far to get the random numbers and display them but tried this and that and couldn't get it to work.
#include <iostream>
using namespace std;
int main()
{
int i, j, k, randomNumber[10];
for(i = 0; i < 10; i++)
{
randomNumber[i] = rand() % 10 + 1;
}
for(k = 0; k < 10; k++)
{
cout << randomNumber[k] << ", ";
}
cin.get();
}
I've tried having other loops inside for loop int i, to check if randomNumber == ..[j] but no output was outputted and yes i did increment j etc. Please help.