hello friends....
TAKE THE FIRST STEP TO KNOWLEDGE FRIENDS BECAUSE KNOWLEDGE IS FREE.
>> /* WRITE A C PROGRAM TO MAKE MATRIX MULTIPLICATION OF TWO 3x3 MATRIX */
#include<stdio.h>
#include<conio.h>
void main()
{
int A[3][3],B[3][3],C[3][3],i,j,k,sum;
clrscr();
printf("enter first matrix A value :\n");
for(i=0; i<=2; i++)
for(j=0; j<=2; j++)
scanf("%d",&A[i][j]);
printf("enter second matrix B value :\n");
for(i=0; i<=2; i++)
for(j=0; j<=2; j++)
scanf("%d",&B[i][j]);
for(i=0; i<=2; i++)
for(j=0; j<=2; j++){
sum=0;
for(k=0; k<=2; k++)
sum = sum + A[i][k]*B[k][j];
C[i][j]=sum;
}
printf("multiplication of two matrix :\n");
for(i=0; i<=2; i++){
for(j=0; j<=2; j++){
printf("%d\t",C[i][j]);
}
printf("\n");
}
getch();
}
/* OUTPUT */
===========================
enter first matrix A value :
1
2
3
4
1
2
3
4
1
enter second matrix B value :
4
3
2
1
4
3
2
1
4
multiplication of two matrix :
12 14 20
21 18 19
18 26 22
* * * * * * * * * * * * * *http://www.dnpdeveloper.com
if you have like this blog so share and subscribe, comment for this blog.
if your any question, so comment pleass.
MY INSTAGRAM ID : dnp176
Comments
Post a Comment