Outputting numbers in arrays
Hi,
I need to write a program that has 2 arrays both with 6 numbers each and compares the two arrays to see if they have any matching numbers.
I have figured out how to output the amount of matching numbers but not the numbers themselves. Here is my function trying to do that...
Code:
int numbers (int draw[], int entry[])
{
int samenumbers = 0;
for(int i=0; i<MAXSIZE; i++)
{
for(int j=0; j<MAXSIZE; j++)
{
if(draw[i]==entry[j])
samenumbers = draw[i];
break;
}
}
return samenumbers;
}
draw and entry are the names of the 2 arrays.
Any ideas of what is wrong?
Thanks