Sunday, 12 May 2013

C# Sort Array Descending



Watch this example on YouTube:

            int[] numbers = { 2, 4, 5, 65, 34, 543, 2, 11, 2 };
            Array.Sort(numbers);
            Array.Reverse(numbers);

            int i = 0;
            for (i=0; i< numbers.Length-1; i++){
                Response.Write(numbers[i].ToString() + "<br />");
            }
           

No comments:

Post a Comment