Selection sort problem

I am failing all the test cases… why is this so?

please share your code through ide.codingblocks.com

here it is

your logic for solving this question is correct, but in the question it is mentioned that while printing the output you need to print each element in new line but you are printing all the elements in the same line.
Corrected Code

thanks a lot!! got it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.