//Write a program to enter the matrix and find the product of matrix.
c[i][j]+=a[i][j]*b[k][j];
}
import [Link].*; }
class Product }
{ [Link]("Product Matrix");
public static void main(String args[]) for(i=0;i<=m-1;i++)
{ {
int m,n,p,i,j,k; for(j=0;j<=p-1;j++)
Scanner sc=new Scanner([Link]); {
[Link]("Enter values of m,n and p:"); [Link](c[i][j]+"\t");
m=[Link](); }
n=[Link](); [Link]();
p=[Link](); }
int a[][]=new int [m][n]; }
int b[][]=new int [n][p]; }
int c[][]=new int [m][p];
[Link]("Matrix A");
for(i=0;i<=m-1;i++)
{ Output:
for(j=0;j<=n-1;j++)
{ Enter values of m, n and p:2
[Link]("Enter a no:"); 2
a[i][j]=[Link](); 2
} Matrix A
} Enter a no:4
[Link]("Matrix B"); Enter a no:7
for(i=0;i<=n-1;i++) Enter a no:8
{ Enter a no:5
for(j=0;j<=p-1;j++) Matrix B
{ Enter a no:6
[Link]("Enter a no:"); Enter a no:7
b[i][j]=[Link](); Enter a no:5
} Enter a no:1
} Product Matrix
for(i=0;i<=m-1;i++) 44 56
{ 88 40
for(j=0;j<=p-1;j++)
{
c[i][j]=0;
for(k=0;k<=n-1;k++)
{