The purpose of this program is to generate 10 sets of 6 random numbers and remove any duplicates in each set. I'm not too familiar with arrays so I'm having trouble making the if statement :(
int main()
{
int i,j;
int removerepeat; int A[]; int 6;
for (i=0; i<10; i++)
{
for (j=0; j<6; j++)
{
cout<<" "<< rand()%74;
if (A[i]==A[j])
return 1;
}
cout<<endl<<endl;
What do you mean by "no duplicates"?
A) Each set has 6 unique values
or
B) All 60 values are unique
Think about a deck of cards. Each card is unique. Shuffled deck has the cards in random order. When you take cards from the deck, you do get unique and random values.
Your "cards" seem to be integers from 0 to 73. You would need a "deck" of 74 integers.
Btw, int A[]; is a syntax error; how many elements does A have? It has to be a known constant value.