Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the use of 'using' statement in c#?

926


What is strongly typed in c#?

922


What is executereader in c#?

913


If dll and exe files are same it means you can deploy both the files in gac?

939


What is the difference between a function and a method?

985


Can abstract class be sealed in c#?

894


How to add a readonly property in c#.net

942


What is public or shared assemblies ?

1027


Explain what a diffgram, and a good use for one Define diffgram? How it be used?

1022


Is datetime value type c#?

884


How do I open the console window?

1041


Is comparable a functional interface?

902


Why constructor is used in c#?

917


Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?

953


I have 3 overloaded constructors in my class. In order to avoid making instance of the class do I need to make all constructors to private?

968