Write a c program to find the product of 2 matrices.
#include
#include
void main()
{
int a[3][3],b[3][3],c[3][3],i,j,k;
clrscr();
printf("\nEnter the first matrix:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("\t%d",&a[i][j]);
printf("\n");
}
printf("\nEnter the second matrix:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("\t%d",&b[i][j]);
printf("\n");
}
printf("\nProduct of two matrices\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=0;
for(k=0;k<3;k++)
{
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
printf("%d\t",c[i][j]);
}
printf("\n");
}
getch();
}
/*Output
Enter the first matrix:
12 34 45
54 65 67
76 78 89
Enter the second matrix:
87 75 53
90 10 20
30 40 50
Product of two matrices
5454 3040 3566
12558 7380 7512
16302 10040 10038
*/
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Tuesday, December 30, 2008
C program to find the product of 2 matrices
Posted by ars at 8:50 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment