get maximum number from collection
Published: 9. October 2011 | Updated: 9. October 2011License: Microsoft Public License (MS-PL)
Categories: Collections » Linq, Framework » Math
Tags: C# Linq Math
Import namespace
using System.Linq;
Code
int[] numbers = new[] { 5, 10, 30, 100 }; int max = numbers.Max(); Console.WriteLine(max);Console Output:
100
| Send us feedback about this snippet » |





