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 a console device?
Explain About multi level and multiple inheritance how to achieve in .net
What is the difference between firstordefault and first?
Why do I get a "cs5001: does not have an entry point defined" error when compiling?
How do I make a dll in c#?
Any .net training centers available near hitech city , hyderabad?
What is difference between list and ilist in c#?
What is default boolean value in c#?
What is the difference between icomparer and icomparable in c#?
What are the basics of c#?
How more than one version of an assembly can keep in same place?
What is the difference between list and array in c#?