this is the link to my code, when i dry run it, as per me it should give the right answer, but i am getting garbage value, please find the wrong logic in my code 
Please help and tell me what is wrong in my code?
Hi Arya
I have corrected ur code https://ide.codingblocks.com/s/610635 its working fine…
Also I have commented the portion was was going wrong in ur code…
hope it clears all ur doubts…
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.
Yes, it is! It’s working thanks a lot 