Max and Min Numbers in C# Using LINQ – Programming, Pseudocode Example, C# Programming Example
Linq List

Max and Min Numbers in C# Using LINQ

LINQ Queries are similar to SQL, So we can use “order by” with desc parametre.

After sorting highest to lowest with “order by descending”, select the first item. Because first item is going to be the highest value. And you can even use  “order by ascending”  to sort as ascending.

 

Here is the example:

Output:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.