Code NOT Passing All Test Cases

My code(picture given below) is only able to solve the first four test cases to the given problem.
Please help me rectify my code, so that it may pass all the test cases.
Thank You.

hello @paulayush2002 please share your code by saving it on ide.codingblocks.com
i would be able to help you in the better way.

I think this link, will direct you to the code. If the link does not work, please inform me.

@paulayush2002 i have corrected your code and commented the mistakes.


if you still have any doubt please ask here .
Happy Learning !!

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.