Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
WAP in C for multiplication of matrices with compatibility Check
#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
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
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
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
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
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
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
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
printf("\t%d",m2[i][j]);
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
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
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]);
else
printf("\n Multiplication is not possible with the order of matrices\n\n");
OUTPUT
Explain the Command Line Parameters? The Command line arguments are parameters supplied to a program from the operating system. These arguments are parameters accepted to main
input marks of c and c++ if c grater than equal to 50 grater than 50 you are pass if c greater than equal to 50 c++ less than 50 than supplementry c++ if c less then 50 and c++ gra
Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules. a. A call made between 8:00 AM and
Define the Bitwise-Exclusive-OR Operator: ^: The bitwise-exclusive-OR operator (^) compares every bit of its first operand to the corresponding bit of its second operand. If on
This assignment builds on Homework 3. The two major modifications are the instruction of pointers and the calculation of mortgage interest rates. Requirements for Project 2:
Develop a C++ program that uses a while to determine the gross pay (in Dollars) for each of several employees. The company pays “straight-time” for the first 40 hours worked by eac
Write algorithm and program for the conversion of a Tree to a Binary Tree
Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code
Write a simple program in C++ to investigate the safety of its enumeration types. Include at least 10 different operations on enumeration types that are incorrect/unsafe things to
In this project, you will write a software for the Registrar's office of a university called YouOIT to maintain information about students and courses at the university. The reg
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!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd