Csharp / C# Linq Max example

Example:

using System;
using System.Linq;
using System.Collections.Generic;

class LinqMaxExample
{
public static void Main(string[] args)
{

int[] nums = { 51,52,53,63,72,110 };

var resutls = nums.Max(n => n);

Console.WriteLine(“The maximum number in the array: ” + resutls);

Console.ReadLine();

}
}



Output:
The maximum number in the array: 110

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>