public static void Main()
int[] arr1=new int[]{1,2,3,4,2};
Console.WriteLine("enter the element to search:");
key=Convert.ToInt32(Console.ReadLine());
for(int i=0;i<=arr1.Length-1;i++)
int last=Array.FindLastIndex(arr1,item=> item==key);
Console.WriteLine("{0} is found in {1} position",key,last);
Console.WriteLine("{0} is not found",key);