Hello.
This is a code for array o size 20 where you can put numbers and they will be in ascending order. however, I do not understand why in last for why do we cout new integer i and not the integers that we have already declared in last for. Why cant we use last for and not the above one?
As they are now, lines 8-17 are trivial to split off into another function with a single distinct purpose. Mixing in output would muck things up a bit.
However, yes, if you wanted, you could have the output done in the outermost loop of your sorting code.