Answers for "how to calculate max value in the list in c#"

C#
2

list.max c#

var list = new List<int> { 1, 2, 3, 4, 5, 6, 7, 16, 17 };  
Console.WriteLine("MAX=>" + list.Max(z => z));  
Console.WriteLine("MIN=>" + list.Min(z => z));
Posted by: Guest on July-30-2021
-3

c# list max

var values = new List<int> { 2, 9, 1, 3 };
Console.WriteLine(values.Max()); // Output: 9

var otherValues = new List<int?> { 2, 9, 1, 3, null };
Console.WriteLine(otherValues.Max()); // Output: 9
Posted by: Guest on May-17-2021

Code answers related to "how to calculate max value in the list in c#"

C# Answers by Framework

Browse Popular Code Answers by Language