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

How do you create empty strings in c#?

886


What is difference between property and variable in c#?

846


Does c# support a variable number of arguments?

966


Explain the concepts of cts and cls(common language specification).

933


What is the use of parse in c#?

852


Is vs as c#?

862


What are the advantages of constructor?

809


What is difference between class and interface in c#?

884


What are the main reasons to use c# language?

909


What are the types of methods in c#?

936


Explain how do you debug an asp.net web application?

884


What are the types in c#?

866


What is a hash table c#?

837


What are primitive data types in c#?

904


What is the difference between private and protected in c#?

898