How can you sort the elements of the array in descending order?

Answers were Sorted based on User's Feedback



How can you sort the elements of the array in descending order?..

Answer / guest

By calling Sort() and then Reverse() methods

Is This Answer Correct ?    15 Yes 0 No

How can you sort the elements of the array in descending order?..

Answer / neoupadhyay

int[] arr = new int[3];
arr(0) = 3;
arr(1) = 5;
arr(2) = 1;

Array.Sort();
Array.Reverse();

Is This Answer Correct ?    10 Yes 2 No

How can you sort the elements of the array in descending order?..

Answer / rambabu

By calling Sort() and then Reverse() methods.

Is This Answer Correct ?    1 Yes 0 No

How can you sort the elements of the array in descending order?..

Answer / payal mehta

We can use Sort property for that.A string that contains
the column name followed by "ASC" (ascending) or "DESC"
(descending). Columns are sorted ascending by default.

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More C Sharp Interview Questions

Is everything an object c#?

0 Answers  


What is serializable in c#?

0 Answers  


Explain how do I get deterministic finalization in c#?

0 Answers  


Difference between direct type casting and using "as" keyword?

1 Answers   TCS,


What does mean before a string in c#?

0 Answers  






What is toint32 c#?

0 Answers  


What is the delegates in c#?

0 Answers  


What is the Use Of Interfaces? For example I have a interface as shown below? Interface IMyInterface { public void MyMethod(); } class MyClass : IMyInterface { public void Mymethod() { Some Code } } class Program { static void Main(string[] args) { MyClass obj = new MyClass(); obj.MyMethod(); } } Here What is My Question is? If i remove Interface and run this code, it will executed then what is the Use of the interface? Can any one give me the solution for this Problem? Thanks in Advance!

1 Answers   HCL,


What exactly happens when we debug and build the program?

0 Answers  


Is clr a compiler?

0 Answers  


What are anonymous methods ? why these methods are used and in what condition these methods are useful ?

1 Answers  


What are Custom Control and User Control?

1 Answers  


Categories