using System.Linq; code example
Example: System Linq c#
int[] myNumbers = {5, 1, 8, 9};
Console.WriteLine(myNumbers.Max()); // 9
Console.WriteLine(myNumbers.Min()); // 1
Console.WriteLine(myNumbers.Sum()); // 23
int[] myNumbers = {5, 1, 8, 9};
Console.WriteLine(myNumbers.Max()); // 9
Console.WriteLine(myNumbers.Min()); // 1
Console.WriteLine(myNumbers.Sum()); // 23