#include <stdio.h>
#include <conio.h>
void main()
{
int a[2][3]={{1,2,3},{4,5,6}};
int b[3][2]={{1,2},{3,4},{5,6}};
int temp[][2]={{0,0},{0,0}};
int i,j,k;
printf("Product of 2*3 and 3*2 matrices is 2*2 ");
printf("which is ::\n");
for(i=0;i<2;i++)
{
temp[2][2]=0;
for(j=0;j<2;j++)
{
for(k=0;k<3;k++)
temp[i][j]+=a[i][k]*b[k][j];
printf("%d\t",temp[i][j]);
}
printf("\n");
}
getch();
}
OUTPUT:
No comments:
Post a Comment