12345678910111213141516171819202122232425262728293031
#include<iostream> #include<conio> int main() { int i,j,m,n,matrix[2][2],adjoint[2][2]; cout<<"\n\nEnter the Elements of the Matrix (2*2) -->\n\n\n"; for(i=0;i<2;i++) for(j=0;j<2;j++) { cout<<"Enter Elements A["<<i<<"]["<<j<<"] : "; cin>>matrix[i][j]; } for(i=1,m=0;i>=0,m<2;i--,m++) for(j=1,n=0;j>=0,n<2;j--,n++) { if(i==j) adjoint[m][n]=matrix[i][j]; else adjoint[i][j]=-matrix[i][j]; } cout<<"\n\nAdjoint of Matrix is - \n\n"; for(i=0;i<2;i++) { for(j=0;j<2;j++) cout<<adjoint[i][j]<<" "; cout<<endl; } getch(); return 0; }