Selection sort out put problem


Sir can u tell me why this program is not working

@anuragavm123 when your are taking the array input you have written cin>>arr[1] it should be cin>>arr[i].
update this your code will work fine.

1 Like

Sir after updating also code is not working fine for zero if i am inputting zero then ans is coming wrong

inside first for loop in the sort function start loop from i=0, else your code will neglect first element.

1 Like

Thank u very much sir and know code is working fine thank u sir

1 Like

@anuragavm123 happy to help, if you don’t have any further queries mark this doubt as resolved.

1 Like