hi,i'm still a beginner in C++, below is a sample program n its output, i would like to know how do I limit the match recorded to only once? Refering 2 the 2nd line output it found a match at array1 element 1 and array2 element2. But it finds the same match again in the 3rd line output at array2 element2.
When a match is found, the scanning shouldn't repeat the matcher array1 and the matched at array2, it should proceed for the new next consequent array's element.
Thanx to anyone who would be able to shed some light in it.thanx alot.

#include <stdio.h>
#define MAX 5
int main(void)
{
int i, j, array1[5], array2[5];

array1[0] = '1';
array1[1] = '0';
array1[2] = '0';
array1[3] = '7';


array2[0] = '1';
array2[1] = '5';
array2[2] = '0';
array2[3] = '2';


for (i=0;i<MAX-1;i++) {
for(j=0;j<MAX-1;j++) {
if (array1[i] == array2[j])
{
printf("we found a match at array1 element %d and array2 element %d \n", i, j);

}
}
}

return 0;

}

Output screen:
we found a match at array1 element 0 and array2 element 0
we found a match at array1 element 1 and array2 element 2
we found a match at array1 element 2 and array2 element 2

thanx again