Code giving runtime error

Can’t identify why the code is giving runtime error for 2 out of 9 test cases.

Code - https://ide.codingblocks.com/s/406706

Hello @PranavM16 you have raised the same doubt twice.

Code is different, check line 33. This code is passing some test cases. The other one is not passing any test cases, its almost the same code just a very minute change. So I wanted to know why this code is passing some test cases while the other one which almost same is not passing any…


i have corrected your code and now it is passing all the test cases:
Happy Learning!!

1 Like

please share the line here:
we will discuss.

i have corrected your code and now it is passing all the test cases:

Was there only ‘cout’ statements added to the code you sent above or was there any other faulty code that you corrected that was giving runtime error?

please share the line here:
we will discuss.

I just saw, you already replied to that doubt Code not giving correct ans

Thanks

@PranavM16 yes i have just added the cout statement:
you can mark this as resolved now.
Happy Learning!!

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.

1 Like