Sum Of All Submatrix From A given Matrix - Approach 2

please explain case when i, j=0…
here is the code:https://ide.codingblocks.com/s/157937