Write an algorithm in pseudocode to perform the multiplicati
Solution
in \'C\' Lang:
/* Description:To multiply given to matrix using arrays*/
#include<stdio.h>
#include<math.h>
main()
{
int i,j,k;
int a,b,c;/*three variables to get the row and colum of the two matrix*/
int sum;
int m[10][10],n[10][10],l[10][10];
printf(\"The first matrix:\ \");
printf(\"Enter the number of rows and columns for the first matrix:\\t\") ;
scanf(\"%d%d\",&a,&b);
printf(\"The Second matrix:\ \");
printf(Enter the rows and columns of the second matrix:\\t:);
scanf(\"%d%d\",&b,&c);
/* Note: For matrix multiplication the number of columns in the first matrix should be equal to the number of rows n the second message*/
printf(\":Enter the values of the first matrix:\ \");
for(i=0;i<a;i++)
{
for(j=0;j<b;j++)
{
scanf(\"%d\",&m[i][j]);
}
}
printf(\"Enter the values of the second matrix:\ \");
for(i=0;i<b;i++)
{
for(j=0;j<c;j++)
{
scanf(\"%d\",&n[i][j]);
}
}
for(i=0;i<a;i++)
{
for(j=0;j<c;j++)
{
sum=0;
for(k=0;k<b;k++)
{
sum=sum+(m[i][k]*n[k][j]);
l[i][j]=sum;
}
}
}
printf(\"The multiplied matrix is:\ );
for(i=0;i<a;i++)
{
for(j=0;j<c;j++)
{
printf (\"%d\",l[i][j]);
printf(\"\\t\");
}
printf(\"\ \");
}
MAIN OPERATION and EFFICIENT OPERATION
printf(\"The multiplied matrix is:\ );
for(i=0;i<a;i++)
{
for(j=0;j<c;j++)
{
printf (\"%d\",l[i][j]);
printf(\"\\t\");
}
printf(\"\ \");
}
number of times of operation execution...
it will be based on the input in the first two matrices



