multiplication of matrices with compatibility check, C/C++ Programming

Assignment Help:

 

WAP in C for multiplication of matrices with compatibility Check

#include

#include

void main()

{

                long int m1[10][10],m2[10][10],i,j,mult[10][10],r1,c1,r2,c2;

                printf("enter order of matrix 1:\n\n");

                scanf("%d %d",&r1,&c1);

                printf("enter order of matrix 2:\n\n");

                scanf("%d %d",&r2,&c2);

                if(c1==r2)

                {

                                printf("Enter element of matrix 1:\n\n");

                                for(i=0;i

                                                for(j=0;j

                                                {

                                                                scanf("%d", &m1[i][j]);

                                                }

                                                printf("\nEnter elements of Martix 2:\n\n");

                                                for (i=0;i

                                                                for(j=0;j

                                                                {

                                                                                scanf("%d",&m2[i][j]);

                                                                }

                                                               

                                                                printf("\n Matrix 1:\n\n\n");

                                                                for(i=0;i

                                                                {

                                                                                for(j=0;j

                                                                                                printf("\t%d",m1[i][j]);

                                                                                printf("\n");

                                                                }

 

                                                                printf("\n matrix 2:\n\n");

                                                                for(i=0;i

                                                                {

                                                                                for(j=0;j

                                                                                                printf("\t%d",m2[i][j]);

                                                                                printf("\n");

                                                                }

                                                                printf("\n Multiplicfation Of Matrices\n\n");

                                                // for matrix multiplication

                                                for(i=0;i

                                                {

                                                                for(j=0;j

                                                                {             

                                                                                mult[i][j]=0;

                                                                                for(long int k=0;k<=r1;k++)

                                                                                {

                                                                                                mult[i][j]+=m1[i][k]*m2[k][j];

                                                                                }

                                                                                printf("\t%d",mult[i][j]);

                                                                }

                                                                printf("\n");

                                                }

                                               

                }

else

printf("\n Multiplication is not possible with the order of matrices\n\n");

}

OUTPUT

 

 

 

1458_multiplication of matrices with compatibility Check.png


Related Discussions:- multiplication of matrices with compatibility check

Area under curve, a program to find the area under curve y=f(x) between x=a...

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.

Thermodynamics, want to solve the thermodynamics problems on c language

want to solve the thermodynamics problems on c language

I want auto-rank script, Project Description: I play this game called mo...

Project Description: I play this game called mobstar (mobstar) and I would like the program to grade my account for me. It would require doing a crime, GTA, jail busting, lead a

Create binomial tree, Create a function ValueDelta(char inName[], char outN...

Create a function ValueDelta(char inName[], char outName[]) that reads a text file with option specifications and writes the option values as well as Delta. The inName[] file conta

FIND AREA UNDER CURVE, Write a program to find the area under the curve y =...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Priority Queue, Ask question #Minimum 100 words acceptedEducational Objecti...

Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

Stack, c++ program to to implement multiple stacks using single array

c++ program to to implement multiple stacks using single array

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd