Getting incorrect o/p

Please make the required changes,i am getting incorrect o/p


Thanks in advance

Modified Code

correct way to take input

for(int i=0;i<m;i++){

        for(int j=0;j<n;j++){

           cin>>a[i][j];

        }

    }