+92 332 4229 857 99ProjectIdeas@Gmail.com

LINQ Min() Method (C#.net)




LINQ MIN() Method (C#.net):
The following code shows you how to find a minimum value from array. We can do this through loop and going through every array index and compare it with all elements in array. But through LINQ Min() method we dont need do all this. See the code below.


Code


int[] array = { 2, 1, 2, 3, 7, 5, 10, 9 };

var query = array.Min();

Console.WriteLine(query);

Output of the program is:
1


0 comments: