#include<stdio.h>
#include<conio.h>
void main()
{
int a[i][j], b[i][j], c[i][j], I, j, k;
int sum=0;
clrscr();
printf("nEnter the first matric:n");
for(i= 0; i<3; i++)
{
for(j= 0; j<3; j++)
scanf("%d", &a[i][j]);
}
printf("nEnter the second matric:n"); for(i= 0; i<3; i++)
{
for(j= 0; j<3; j++)
scanf("%d", &b[i][j]);
}
printf("The first matric is:n");
for(i= 0; i<3; i++);
{
for(j= 0; j<3; j++)
printf("%d", a[i][j]);
printf ("n");
}
printf("The second matric is:n");
for(i= 0; i<3; i++)
{
for(j= 0; j<4; j++)
printf("%d", a[i][j]);
printf ("n");
}
for(i= 0; i<3; i++)
for(j= 0; j<=2; j++)
{
sum= 0;
for(k= 0; k<=2; k++)
sum= sum+ a[i][j]*b[i][j];
sum=c[i][j];
}
printf("The multiplication of two matrics:nn");
for(i= 0; i<3; i++)
{
for(j= 0; j<3; j++)
printf("%d ", c[i][j]);
printf ("n");
}
getch();
}
Monday, 26 August 2019
How to write a program to multiply two matrics?
Labels:
matrics_program,
multiple
Subscribe to:
Post Comments (Atom)
Very nice and easy to understand
ReplyDelete