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
Define sealed classes in c#?
Why is static constructor called first?
What is .cs file in c#?
How big is a 64 bit integer?
Is c# good for games?
Can a abstract class have a constructor?
Are enums static c#?
In which order the destructor is called for an inherited class?
Explain About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.
List down the access modifiers available in c#?
Illustrate serialization?
What is the use of inheritance in c#?
What is a static in c#?
How to rotate an Image in C#?
Can you declare a class or a struct as constant?