Problem related to output

If the first input of array is -4 then current sum should be -4 after the completionof first iteration of k loop then why it showing 0 and how can i drag and drop images in my description

i am waiting for the answer

Please mention the time stamp in the video so that i can check what you are referring to

time stamp is 4:28 if i consider the 4 as a subarray of length 1 so it should show -4 pls explain

All subarrays are being printed there.
If you consider 4 as a subarray then 4 will only be printed.
Write that code on ide.codingblocks.com and check that output.

Yes in the starting, -4 is not being printed, because the cout statement in line 27 is outside the loop.
If you bring it inside the loop, after line 25 then the desired output will be printed.

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.