Click here to Skip to main content
15,606,032 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Please help to solve this case:
There is a project that needs to accept the total number of array elements and values from the user. It also needs to arrange the array elements in ascending order, and display the result. (Hint: The array should be an integer array). How to write the code in C#?

-Question by Sun_Shine.. :-D
Updated 8-Mar-11 6:17am
fjdiewornncalwe 8-Mar-11 16:48pm    
You should do your own homework first, Sun_Shine, and then ask questions specific to issues that arise. You'll be a much better developer in the long run if you fight through issues first and not try to get others to do it for you.

Have a look at the array.sort method:[^]
or see this link with a lot of samples:[^]
Share this answer
Espen Harlinn 13-Mar-11 8:53am    
Nice and simple, my 5
Share this answer
int[] array = new int[] { 3, 1, 4, 5, 2 };

//Declare Array

Array.Sort<int>( array );

// Sort Method used Asending Order

Array.Reverse( array );

// reverse Method used Decenting Order
Share this answer
[no name] 20-Apr-13 10:57am    
You are only 2 years too late to do the OP's homework for them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900