To sort all the numbers up to 10 in C#, create an integer array of numbers from 1 to 10 and sort it using the built-in Array.Sort() function.
main.cs152 chars3 lines
Now, the numbers
array will be sorted in ascending order from 1 to 10. You can print the sorted array to the console using the following code.
main.cs69 chars5 lines
This will output: 1 2 3 4 5 6 7 8 9 10
.
gistlibby LogSnag