How can you sort the elements of the array in descending
order?
Answer Posted / 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 |
Post New Answer View All Answers
When To use HashTable In C#
What is a thread c#?
What is sqlcommandbuilder c#?
What is gac? How to put assembly in gac?
What is a value type in c#?
What does == mean in c sharp?
What are data types examples?
What is command object in c#?
What is a copy constructor in c#?
What is generic and non generic collections in c#?
Is hashset ordered c#?
How many variables do you need?
What is file extension of webservices?
Is datetime immutable c#?
Explain manifest in c#.