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
Write a program to show the change in position of a cursor using c
What do you mean by c what are the main characteristics of c language?
What does %p mean?
What is adt in c programming?
if p is a string contained in a string?
Why c language is called c?
What are the keywords in c?
What is the c language function prototype?
Is main is user defined function?
What are identifiers in c?
Explain what are its uses in c programming?
Is c is a procedural language?
Why c language?
Explain union. What are its advantages?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?