Output Error

I have a difference of output for : Reversing Array

My code : https://pastebin.com/nCTMgKjP

Expected output :
9
15
7
12
4

My Output :
9
15
7
12
4
0

Please help. @vijju1231 @ssjgz

In the second loop you are doing i<=N which gives an extra element
Do it for (int i=0;i<N;i++)
It will work

1 Like

It worked, thanks @predominator !

1 Like