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

When static constructor is invoked?

9 Answers   TCS,


Why is the XML InfoSet specification different from the Xml DOM? What does the InfoSet attempt to solve ?

1 Answers  


What you mean by inner exception in c#?

0 Answers  


What is type keyword in c#?

0 Answers  


An Array is a Ref Type? what about the array elements which are value type(int,Float...etc)?

6 Answers  


How many types of namespaces available in version4?

0 Answers   HCL,


can it possible to acees the virthual method using the override method object? plz give me the example

2 Answers  


How to find whether the application is run from inside ide or not?

0 Answers  


Can a abstract class have a constructor?

0 Answers  


what is scope of a protected internal member variable of a c# class

0 Answers   Cognizant,


Is as operator in c#?

0 Answers  


what is application domain?

4 Answers   Kanbay,


Categories