User Id :    Password :      New Member   Forgot Password  
 
Find lowest number in an array in LINQ
Description Find lowest number in an array in LINQ   No. of Views     2321
  Rating     0
Author Deepika Chauhan   Posted On     15 Feb 2011
Tags ADO.NET,C#,LINQ,LINQ to Object    

Sample Code   Download Code

 
Introduction
 
We often need to find the lowest number in an array of integer or real number.
 
Here I will explain how easy it is to find lowest number in C# using LINQ.
 
 
public void FindLowest()
{
    int[] arrAge = { 12, 8, 11, 13, 1, 28, 9, 67, 12, 10 };
 
    int minAge = arrAge.Min();
 
    Response.Write ("The minimum Age is {0}.", minAge);
}

 

Code Explanation

 In the first line I have declared an array of int. In the second line you can see I have used Min function to get the minimum in the array.

 

Output

The minimum Age is 1

 

About Author

About Author N/A Deepika
No Photo
 
Country N/A
Company Birlasoft
Home Page N/A

Rate this article

Rating options from poor, fair, good, very good to excelent.  
 

Comments

   
Write your comment here.
Comment
Verification Code