belongs to collection: C# language array programs with an examples
Write C# Program to Find Minimum and Maximum of Numbers
I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability.
using System; using System.Linq; class Program { static void Main() { int[] Arr = { 20, -10, -30, 0, 15, 10, 30 }; Console.WriteLine("Maximum Element : " + Arr.Max()); Console.WriteLine("Minimum Element : " + Arr.Min()); Console.Read(); } }
Result:
Maximum Element : 30
Minimum Element : -30
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability.
Result:
Maximum Element : 30
Minimum Element : -30
need an explanation for this answer? contact us directly to get an explanation for this answer