Doubt in my code

Hello, here is my code :

I know what is the issue with my code. It is adding the digits of the two arrays but with the wrong index values. I need some help to resolve this issue.

So the line in which you are doing it wrong is 19, suppose a array has size 5
B array has size 4
In your s, you are storing a[5] & b[5](which doesn’t exist)
I would suggest you to take reference from this

1 Like

If you still have problem In understanding it you can ask me.