SPOJ "It's a murder!" challenge
Your main issue is this line:

 memset(sum1,0,sizeof(sum1)) ;


The whole array is being initialized to zero, even if you are only dealing with a range of one element.  You really only need to initialize the first element:

sum1[0] = 0; // initialize here

// copying into array1 from left to mid 
index1 = 0 ;
for(index=left;index&lt;mid+1;index++)
{
    if(index1!=0)
    {
        sum1[index1] = sum1[index1-1] + array1[index1-1] ;
    }


The rest is already assigned proper values.