To find the Max and Min Value from an Integer Array , one could use the functions Max() and Min() defined in the array object.
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication1 { static class Program { static void Main() { data(); } // sourcecode to find the Max and Min value in a array of integer static void data() { int[] arrData = new int[5] { 75, 100, 26, 10, 8 }; MessageBox.Show(arrData.Max().ToString()); MessageBox.Show(arrData.Min().ToString()); } } }
Leave a Reply