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 are bitwise logical operators?

880


What do you mean by hashtable c#?

993


What is the difference between User controls and Custom Controls?

1057


if you do have a stack overflow profile.what is your ranking?

1870


What is session variable in c#?

992


If I want to override a method one of class A and in class b then how do you declare?

1284


If a method's return type is void, can you use a return keyword in the method?

871


How do I simulate optional parameters to com calls?

936


Is string primitive?

850


How to declares a two-dimensional array in C#?

1009


What is data hiding in c#?

883


Is namespace a class?

864


What is the implicit name of the parameter that gets passed into the set method/property of a class?

912


What debugging tools come with the .NET ssSDK?

1225


Will the following code compile?

945