Contact: aviboots(AT)netvision.net.il
39,890 questions
51,821 answers
573 users
using System; class Program { static void Main() { int[] arr = new int[] {9, 7, 3, 5, 0, 6}; Array.Sort(arr); Array.Reverse(arr); foreach (int n in arr) { Console.WriteLine(n); } } } /* run: 9 7 6 5 3 0 */
using System; class Program { static void Main() { int[] arr = new int[] {9, 7, 3, 5, 0, 6}; Array.Sort<int>(arr, new Comparison<int>((a, b) => b.CompareTo(a))); foreach (int n in arr) { Console.WriteLine(n); } } } /* run: 9 7 6 5 3 0 */