CPP: Maximum Subarray Sum

Sir , my code is passing for all test cases , but the fact is that if all the elements are 0, then the output must be a non zero number ,but it will be 0.
My code is :

@Riankk
Hello Krishanu,
if all elements are zero then your answer should be zero because that is only possible subarray sum u can get

Sir,
Sorry, I mistyped the question. My question was if all the elements are negative, than the output is 0, which must not be the case.

@Riankk
In kadane algorithm there must be at least one positive number (source wikipedia).
if u r not using kadane then return maximum among the given elements

@Riankk
Hello Krishanu,
let me know ,if u still have any doubt in this problem