static int maxSubArraySum(int []a)
int max_so_far = int.MinValue,
for (int i = 0; i < size; i++)
max_ending_here = max_ending_here + a[i];
if (max_so_far < max_ending_here)
max_so_far = max_ending_here;
public static void Main ()
int [] a = {-2, -3, 4, -1, -2, 1, 5, -3};
Console.Write("Maximum contiguous sum is " +