Jan
24
#include<stdio.h>
#include<conio.h>
#define MAX 3
void main(){
int i,j,k;
int arr1[MAX][MAX],arr2[MAX][MAX],arr3[MAX][MAX];
printf(“Enter%d elements of matrix A row-wise\n”,MAX*MAX);
for(i=0;i<2;i++){
for(j=0;j<2;j++){
scanf(“%d”,&arr1[i][j]);
}
}
for(i=0;i<2;i++){
for(j=0;j<2;j++){
scanf(“%d”,&arr2[i][j]);
}
}
for(i=0;i<2;i++){
for(j=0;j<2;j++){
arr3[i][j]=0;
for(k=0;k<2;k++){
arr3[i][j]+=arr1[i][k] * arr2[k][j];
}
}
}
for(i=0;i<2;i++){
for(j=0;j<2;j++){
printf(“%d “,arr3[i][j]);
//arr2[j][i]=arr1[i][j];
}
printf(“\n”);
}
getch();
}
Leave a Reply
No Comments