You can use min / max of array + While loop.
The first loop creates a random array. While loop keeps picking min integer for as long as there anything in the unsorted left, adds it to a sorted array and removes it from unsorted. This prints the sorted from min to max value.