int[] ints = { 10, 45, 15, 39, 21, 26 };
foreach (var i in ints.OrderBy(g => g))
{
System.Console.Write(i + " ");
}
Console.WriteLine();
var str = new string('-', 10);
Console.Write(str);
Console.WriteLine();
foreach (var i in ints.OrderByDescending(g => g))
{
System.Console.Write(i + " ");
}
Console.WriteLine();