Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #107.73K
1 Posted Topic
pls check this int arr[]={-2,1,-3,4,-1,2,1,-5,4}; int sum=0; int max=0; for(i=0;i<=8;i++) { if(a[i]<=0) { sum=sum+a[i]; if(sum<0) sum=0; } else {sum=sum+a[i] } if(sum>max) max=sum; } printf("%d",max);
The End.
VIKAS REDDY