Desired Output not coming

Sir,

Please help me find the error in the code of selectionsort. The correct output is not coming .

hi Ujjwal,
kindly save ur code coding blocks ide and send link…

hi Ujjwal,
there were 2 mistakes-

  1. u were taking wrong i/p
    u were inputting
    5 4 3 2 1
    while it should be
    5
    5 4 3 2 1

  2. in line 31 u were putting a semicolon after if statement… remove that…

corrected code --> https://ide.codingblocks.com/s/642294

1 Like

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.