What is wrong with my code

Your code is not giving the correct output even for the sample test. Dry run for it and check.Also the endl in line 7 is not required.

sorry i cannot find my mistake in my code while dry running it. kindly make the required changes in my code to show where i went wrong.

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.