How to make this program
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main(){
clrscr();
for(i=0;i<10;i++)
for(j=0;j<10;j++)
printf("a[%d][%d] = %d \n",i,j,a[i][j]);
printf("cu pointer\n");
for(i=0;i<10;i++)
for(j=0;j<10;j++)
printf("a[%d][%d] = %d \n",i,j,*(p+i));
getch();
}
int a[4][4],b4[3][3],b1[3][3],b2[3][3],b3[3][3],n,c1,c2,c3,c4,i,j;
printf("\nIntroduceti elementele Matricei cu 4 linii si 4 coloane: \n");
int *mat;
n=4;
for (i=0; i<n; i++){
for (j=0; j<n; j++){
printf("a[%d][%d]=",i+1,j+1);
scanf("%d",&a[i][j]);
}
}
printf("\n Matri: \n");
for (i=0; i<n; i++){
for (j=0; j<n; j++){
printf("%2d ",a[i][j]);
}
printf("\n");
}
for (i=0; i<n-1; i++){
for (j=0; j<n-1; j++){
b1[i][j]=a[i+1][j+1];;
}
printf("\n");
}
printf("\t Matri b1 : \n");
for (i=0; i<n-1; i++){
for (j=0; j<n-1; j++){
printf("%2d ",b1[i][j]);
}
printf("\n");
}
for (i=0; i<n-1; i++){
for (j=0; j<n-1; j++){
b2[i][j]=a[i][j];
}
printf("\n");
}
printf("\tMatri b2: \n");
for (i=0; i<n-1; i++){
for (j=0; j<n-1; j++){
printf("%2d ",b2[i][j]);
}
printf("\n");
}
for (i=0; i<n-2; i++){
for (j=0; j<n-2; j++){
b3[i][j]=a[i][j];
}
b3[2][0]=a[3][0];
b3[2][1]=a[3][1];
b3[2][2]=a[3][3];
b3[1][2]=a[1][3];
b3[0][2]=a[0][3];
printf("\n");
}
printf("\tMatri b3 : \n");
for (i=0; i<n-1; i++){
for (j=0; j<n-1; j++){
printf("%2d ",b3[i][j]);
}
printf("\n");
}
for (i=0; i<n-2; i++){
for (j=0; j<n-2; j++){
b4[i+1][j+1]=a[i+2][j+2];
}
b4[0][0]=a[0][0];
b4[1][0]=a[2][0];
b4[2][0]=a[3][0];
b4[0][1]=a[0][2];
b4[0][2]=a[0][3];
printf("\n");
}
printf("\tMatri b4 : \n");
for (i=0; i<n-1; i++){
for (j=0; j<n-1; j++){
printf("%2d ",b4[i][j]);
}
printf("\n\n");
}
c1=a[0][0]*( b1[0][0]*b1[1][1]*b1[2][2] + b1[1][0]*b1[2][1]*b1[0][2] + b1[2][0]*b1[0][1]*b1[1][2] - b1[0][2]*b1[1][1]*b1[2][0] - b1[1][2]*b1[2][1]*b1[0][0] - b1[1][0]*b1[0][1]*b1[2][2] );
printf("\nComplementul algebric fata de elementul diagonalei principala a[1][1]: %d", c1);
c2=a[1][1]*( b4[0][0]*b4[1][1]*b4[2][2] + b4[1][0]*b4[2][1]*b4[0][2] + b4[2][0]*b4[0][1]*b4[1][2] - b4[0][2]*b4[1][1]*b4[2][0] - b4[1][2]*b4[2][1]*b4[0][0] - b4[1][0]*b4[0][1]*b4[2][2] );
printf("\nComplementul algebric fata de elementul diagonalei principala a[2][2]: %d", c2);
c3=a[2][2]*( b3[0][0]*b3[1][1]*b3[2][2] + b3[1][0]*b3[2][1]*b3[0][2] + b3[2][0]*b3[0][1]*b3[1][2] - b3[0][2]*b3[1][1]*b3[2][0] - b3[1][2]*b3[2][1]*b3[0][0] - b3[1][0]*b3[0][1]*b3[2][2] );
printf("\nComplementul algebric fata de elementul diagonalei principala a[3][3]: %d", c3);
c4=a[3][3]*( b2[0][0]*b2[1][1]*b2[2][2] + b2[1][0]*b2[2][1]*b2[0][2] + b2[2][0]*b2[0][1]*b2[1][2] - b2[0][2]*b2[1][1]*b2[2][0] - b2[1][2]*b2[2][1]*b2[0][0] - b2[1][0]*b2[0][1]*b2[2][2] );
printf("\nComplementul algebric fata de elementul diagonalei principala a[4][4]: %d", c4);
getch();
return 0;
}
with pointers, This is a program that calculates the algebraic complement
Sorry for my english