to find the program of matrix multiplication using arrays
Answer Posted / suman kumar das.
//matrix multiplication program
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,k,a[3][3],b[3][3],c[3][3],sum,m=3,l=3;
printf("\n enter value of first matrix:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&a[i][j]);
}
printf("\n enter value of second matrix:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&b[i][j]);
}
for(i=0;i<m;i++)
{
for(j=0;j<l;j++)
{
c[i][j]=0;
for(k=0;k<l;k++)
c[i][j]+=a[i][k]*b[k][j];
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%d",c[i][j]);
}
getch();
}
| Is This Answer Correct ? | 24 Yes | 14 No |
Post New Answer View All Answers
What is the purpose of clrscr () printf () and getch ()?
what is the syallabus of computer science students in group- 1?
What are the different data types in C?
Is there anything like an ifdef for typedefs?
How many keywords are there in c?
Is file a keyword in c?
develop algorithms to add polynomials (i) in one variable
Write a program to swap two numbers without using third variable?
What are register variables in c?
Explain what are the __date__ and __time__ preprocessor commands?
Explain built-in function?
How variables are declared in c?
What is boolean in c?
What is printf () in c?
What was noalias and what ever happened to it?