for( li=0; li <=max_row-1; li ++)
for(lj =0; lj <=max_col-1; lj ++)
for(bi = li; bi <=max_row-1; bi++)
for(bj=lj; bj<=max_col-1; bj++){
sum+= arr[bi][bj] - arr[li-1][bj] - arr[bi][lj-1] + arr[li-1][lj-1];
}
Sir told us this code but when li or lj will be equal to 0 then li-1 and lj-1 will become -1 and then arr[ li-1] will become arr[-1] which will give garbage value.
So how to resolve this??