## awais1a

i have an assignment can somebody help me,

Assignment Statement: Comparing two arrays for equality or matching indexes

You are required to write a program which will take input from user in two integer arrays. The program should compare both arrays for checking if both arrays are totally identical (Exactly same). If not, then program should determine the matching indexes of both arrays. Matching indexes means that first element of array1 should be equal to first element of array2 and so on.

## spetro3387 -1

Try to write the code out and see if you get the answer. This is simpler than you think. If you really can't get it, post your code (make sure you use code blocks) and we will give you some code/advice.

-Sam

## arkoenig 340

If this is the biggest problem of your life, you are truly blessed.

commented: LOL! :) +4

## spetro3387 -1

haha, yea I agree. "please help me i having biggest problem of my life;" is pretty dramatic.

## awais1a

i attempt this code but it doesn't run, plz help me
#include<iostream.h>
#include<conio.h>
void match(int a[10],int b[10]);
void main()
{
int x[10],y[10],m,n;
clrscr();
cout<<"Enter elements of 1st array:"<<endl;
for(m=1;m<11;m++)
{
cout<<"element "<<m<<" is =";
cin>>x[m];
}
cout<<"Enter elements of 2nd array:"<<endl;
for(n=1;n<11;n++)
{
cout<<"element "<<n<<" is =";
cin>>y[n];
}
match (x,y);
getch();
}
void match(int a[10], int b[10])
{
int i,j;
{
cout<<"array1\tarray2"<<endl;
for(j=1;j<2;j++)
{
for(i=1;i<11;i++)
if(a[j]==b[j])
cout<<a[j]<<"\t"<<b[j]<<endl;
else
{
for(i=1;i<11;i++)
if(a[j]!=b[j])
cout<<a[j]<<"\t"<<b[j]<<endl;
else
cout<<"mathch";
}
}
}
}