There are a number of options. Here is the most common I use.
Linq over a List can also be used.
// C# program sort an array in
// decreasing order using
// CompareTo() Method
using System;
class GFG {
// Main Method
public static void Main()
{
// declaring and initializing the array
int[] arr = new int[] {1, 9, 6, 7, 5, 9};
// Sort the arr from last to first.
// compare every element to each other
Array.Sort<int>(arr, new Comparison<int>(
(i1, i2) => i2.CompareTo(i1)));
// print all element of array
foreach(int value in arr)
{
Console.Write(value + " ");
}
}
}
or
// C# program sort an array in decreasing order
// using Array.Sort() and Array.Reverse() Method
using System;
class GFG {
// Main Method
public static void Main()
{
// declaring and initializing the array
int[] arr = new int[] {1, 9, 6, 7, 5, 9};
// Sort array in ascending order.
Array.Sort(arr);
// reverse array
Array.Reverse(arr);
// print all element of array
foreach(int value in arr)
{
Console.Write(value + " ");
}
}
}