In simple array You can manually perform max min algorithm . for more you can used collection like arraylist ,SortedList etc. in Simple Array You can used the following Code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Exercise
{
public class Program
{
static int Main(string[] args)
{
var Numbers = new double[10];
var Minimum = 0D;
var Maximum = 0D;
Numbers[0] = 4478.72;
Numbers[1] = 67.97;
Numbers[2] = 2.32;
Numbers[3] = 13004.05;
Numbers[4] = 0.44;
Numbers[5] = 873846.08;
Numbers[6] = 120.12;
Numbers[7] = 479.23;
Numbers[8] = 12.42;
Numbers[9] = 873846.04;
Minimum = Numbers[0];
for (var i = 0; i < Numbers.Length; i++)
{
Console.WriteLine("Number {0,2}:{1, 10}", i + 1, Numbers[i]);
}
for (var i = 0; i < Numbers.Length; i++)
{
if (Minimum > Numbers[i])
Minimum = Numbers[i];
}
Console.WriteLine();
Console.WriteLine("Minimum = {0}", Minimum);
for (int i = 0; i < Numbers.Length; i++)
{
if (Maximum < Numbers[i])
Maximum = Numbers[i];
}
Console.WriteLine("Maximum = {0}\n", Maximum);
return 0;
}
}
}