About max subarray sum 1

sir,
there will be an error in the given code that if all entered no. are -ve , then max sum should surely be -ve .But the code gonna show max sum=0 in that case which is wrong ??!!!

Hey @gargshivam2001
just initialize ur sum as large -ve number
int sum=-99999999