Generate subarray sum

why am i getting wrong(and same) sum for each
subarray

misplaced currentsum

Pls paste your code on IDE and share the link.

How can I get your code?