C# code to get Max of numeric array collection

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 1240
C# code to get Max of numeric array collection

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

namespace DNFPractice
{
class Program
{
public static void Main(string[] args)
{
int[] dnf = new int[3];
dnf[0] = 10;
dnf[1] = 20;
dnf[2] = 30;
int result = dnf.Max();
Console.WriteLine("Result {0}", result);
Console.ReadLine();
}
}
}



Output will be:
Result 30

Thanks
Amatya

Comments or Responses

Login to post response