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 class c#?
how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.
What is lazy keyword in c#?
What is void in c#?
Is there any sample c# code for simple threading?
Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio ?
What are c# collections?
Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
What is lambda expression in c#?
What are the types of inheritance in c#?
How is a string immutable?
Expalin the way you implement inheritance by using VB.NET/C#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)