Printing o/p in increasing order

I m encountering an extra garbage value at the end of o/p.
Can you please check the code

cout in the main is not required since you are already printing the result in the recursive function.

oh sorry…thank you.