CSharp examples for System:Array Find
Find Maximum Value in int array
using System.Collections.Generic; using System;/*from w w w .ja va 2 s .c om*/ public class Main{ internal static int FindMaximumValue(params int[] elements) { if (elements == null || elements.Length == 0) { throw new ArgumentException("No elements to evaluate."); } var maximumValue = elements[0]; for (int i = 1; i < elements.Length; i++) { if (maximumValue < elements[i]) { maximumValue = elements[i]; } } return maximumValue; } }