Sir, where is my mistake?

sir, here is my code >>>https://ide.codingblocks.com/s/584637

sir, for custom input code works fine, but it is showing wrong answer.
please mark my mistake.

Hi
image
u had declared the array a outside while loop. just declare it in while loop. it will work fine

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.