Why is this so?

in the function part
when i use for(int j = s;j<e;j++)
the answer is completely fine but when I am using
for(int j = 0; j<e;j++){
the answer is not coming correct

in the image attached the recent answer came to be 6422260 5 4 2 3
when I used j = 0

but when I used j = s
the answer was correct… o/p - 1 2 3 4 5

Input was given N = 5
5 4 3 2 1

kindly provide me the code in link format so that it will easy to debug .

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.