Here is my code:
include
using namespace std; int main() { int arr[3][3]; for(int i=0;i<3;i++) for(int j=0;j<3;j++) cin>>arr[i][j]; int r1,r2,r3,x,y,z; for(int i=0;i<3;i++) { r1+=arr[0][i]; r2=arr[1][i]+arr[1][i]; r3=arr[2][i]+arr[2][i]; } x=(r2+r3-r1)/3; y=(r1+r3-r2)/3; z=x-(r1+r2-r3)/3; arr[0][0]=x; arr[1][1]=y; arr[2][2]=z; for(int i=0;i<3;i++){ { for(int j=0;i<3;j++) cout<<arr[i][j]; } cout<<endl; } return 0; }
I am getting the output as : Runtime error: exit code is -1073741819 Your help will be appreciated!!