Multiplication of matrix

To find the product of two we use arrays to define a matrix size and then using loops the multiplication prosedure is done for the matrices.

Inputs to the script

User has to enter matrix size and elements


By looping through elements the multiplication is done.

Output of the script

We will get product of the matrix in matrix form
 void main()
 int a[5][5],b[5][5],c[5][5],i,j,k,sum=0,m,n,o,p;
 printf("\nEnter the row and column of first matrix"); 
scanf("%d %d",&m,&n); 
printf("\nEnter the row and column of second matrix"); 
scanf("%d %d",&o,&p); if(n!=o) { printf("Matrix mutiplication is not possible");
 printf("\nColumn of first matrix must be same as row of second matrix");
 } else { 
printf("\nEnter the First matrix->");
Your Rating

Post Comment This is for short comments only. for more discussions.

HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 All rights reserved worldwide Privacy Policy Disclaimer