How can you sort the elements of the array in descending
order?
Answers were Sorted based on User's Feedback
Answer / anubhav gupta
int[] arr = new int[4];
arr[0] = 22;
arr[1] = 33;
arr[2] = 11;
arr[3] = 44;
Array.Sort(arr);//First sort the array in accending
order
Array.Reverse(arr);//then do reverse of array for
descending order
foreach (int a in arr)
{
Response.Write(a+"--");
}
Is This Answer Correct ? | 4 Yes | 0 No |
What is base class in c#?
Can hashtable have duplicate keys in c#?
What are cshtml files?
What does void do in c#?
Why we use methods in c#?
Which class comes after the SortedList class?
Can interface inherit class in c#?
How do I open the console window?
Explain how to parse a datetime string?
What is the difference between static class and sealed class in c#?
Is it possible to nest cfml conditional tags?
What is class sortedlist underneath?