import [Link].
Scanner;
public class Main
{
public static void main(String[] args)
{
int i,j,count;
Scanner sc= new Scanner([Link]);
[Link]("Enter the number of elements in each array");
int n=[Link]();
int a[]=new int[n];
[Link]("Enter the array 1 elements");
for(i=0;i<n;i++)
{
int num=[Link]();
a[i]=num;
}
int b[]=new int[n];
[Link]("Enter the array 2 elements");
for(j=0;j<n;j++)
{
int num=[Link]();
b[j]=num;
}
[Link]("The elements of array 1 are");
for(i=0;i<n;i++)
{
[Link](" "+a[i]);
}
[Link]("The elements of array 2 are");
for(j=0;j<n;j++)
{
[Link](" "+b[j]);
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[i]==b[j])
{
[Link]("Both the arrays have same element");
break;
}
else
{
[Link]("Both the array do not have same element");
break;
}
}
}
}
}