Use some sort algorithm - for example Quicksort
Although, for very small arrays (as in your example) you better use more simple algorithm as Bubble sort
The later, because of the very easy implementation (smaller code) will be faster than the complex Quicksort for small arrays.