Sum of two arrays wrong output

i have checked the code multiple times but in first array at index 0 , it always takes 7 as input irrespective of what i am giving as an input , otherwise logic seems fine , please help !
code link : https://ide.codingblocks.com/s/99123

After second loop, the value of a[0] is automatically changing to 7.

Solution:
Assign the value of A[0] to a variable before second loop and then after the loop assign the value of variable back to A[0].

Hope, this would help.

1 Like

@S18ML0016 thank you , all test cases have been accepted .

you can give a like, I won’t mind. :joy:

1 Like