Get Min value from an int array in CSharp

Description

The following code shows how to get Min value from an int array.

Example


  //  ww  w.j a v a  2 s  . c o  m
  
  
    

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 minInt = myInts.Min();
        Console.WriteLine(minInt);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    LINQ »




Operator
Select
Where
OrderBy
Group
Join
Let
LINQ