2D array brute force O(N^6}

Im having no errors in my code but im not able to get my output (i.e. sum of all submatrix of a given matrix}

Check now.You were not initializing the 2D array correctly

  1. you have not intialize 2D array correctly
    correct way is
    int a[2][2]={{1,1},{1,1}};

  2. at line no 13 for(int lj=0;lj<n;li++)
    lj should increase not li

  3. there is no header file conio.h in c++

Modified Code