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);
1
0 comments:
Post a Comment