//This code will join the arrays on the basis of the common values
using System;
using System.Linq;
class arrayjoin
{
static void Main()
{
int[] arr={10,20,30};
int[] arr1={20,30,40};
var q=from p in arr join r in arr1 on p equals r select new {p,r};
Console.WriteLine("the join is");
foreach(var z in q)
{
Console.WriteLine(z);
}
}
}
//The output :
// The join is
// {p=20,r=20}
// {p=30,r=30}