public static void Main()
var random = new Random();
var list = new System.Collections.Generic.List<int>();
for (var i=0; i < 10000; i++) {
list.Add(random.Next(1,1000));
var most = MostFrequent(list);
Console.WriteLine(string.Format("The number {0} appears the most times", most));
private static int MostFrequent(System.Collections.Generic.IEnumerable<int> list)