C Program of multiplication of two matrix.
#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],c[3][3]={0},i,j,k;
clrscr();
printf("MATRIX MULTIPLICATION\n");
printf("Enter the values of matrix A\n");
for(i=0;i<3;i++) {
for(j=0;j<3;j++) {
scanf("%d",&a[i][j]); } }
printf("Enter the values of matrix B\n");
for(i=0;i<3;i++) {
for(j=0;j<3;j++) {
scanf("%d",&b[i][j]); } }
for(i=0;i<3;i++) {
for(j=0;j<3;j++) {
for(k=0;k<3;k++) {
c[i][j]=c[i][j]+a[i][k]*b[k][i]; } } }
printf("Result of multiplication of matrix is\n");
for(i=0;i<3;i++) {
for(j=0;j<3;j++) {
printf("%d ",c[i][j]); }
printf("\n"); }
getch();
}
0 Comments
Have any query? Want any type of module?
Please comment it down and let me know.