World's most popular travel blog for travel bloggers.

Write a C program to perform the following operation on matrices D = A + (B * C), where A, B and C are matrices of (3 X 3) size and D is the resultant matrix.

, , 3 comments

Ans.
#include<stdio.h>
#include<conio.h>
Void main()
{
int a[3][3],b[3][3],c[3][3],d[3][3];
int i,j,k;
for(i=0;i<=5;i++)
{
for(j=0;j<=5;j++)
{
for(k=0;k<=5;k++)
{
e[i][j]=e[i][j]+b[i][k]*c[k][j];
}
}
}
for(i=0;i<=5;i++)
{
for(j=0;j<=5;j++)
{
D[i][j]=a[i][j]+e[i][j];
}
}
for(i=0;i<=5;i++)
{
for(j=0;j<=5;j++)
{
printf(“%d \t”,d[i][j]);
}
printf(“\n”);
}

3 comments:

  1. I liked your work and the way in which you have shared this blog here c programming homework It is a beneficial and helpful blog for us. Thanks for sharing a blog like this.

    ReplyDelete
  2. 2D Array 'e' is not initialised

    ReplyDelete

Let us know your responses and feedback