Max on int array : Max « LINQ « C# / C Sharp






Max on int array

 

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class MainClass {
    public static void Main() {
        int[] myInts = new int[] { 974, 2, 7, 1374, 27, 54 };
        int maxInt = myInts.Max();
        Console.WriteLine(maxInt);
    }
}

 








Related examples in the same category

1.Max on String array
2.Max on object list
3.Max on Object list array
4.uses Max to get the highest number in an integer array.
5.uses Max to get the length of the longest word in a string array.
6.Grouped Max
7.Get the Min and max value from a query