using System;
using System.Collections.Generic;
public class program
{
public static void Main()
int[] num={1,2,3,4,5,6};
Dictionary<int, int> Count= new Dictionary<int , int>();
foreach(int x in num)
if(Count.ContainsKey(x))// if the dic already have the said x key
Count[x]++;
}
else
Count[x]=1;// all keys are first one; then if there is a repeat the above will exucute
foreach(KeyValuePair<int,int> kvp in Count)
if(kvp.Value>1)
Console.Write("Number: {0} Times appeared in arrary {1", kvp.Key, kvp.Value);