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
#question.develop an algorithm using pseudocode for computing cos(x) and sin(x). use a sentinel controlled while loop. use the series definition of e^+-jx
An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied
You are to write a C++ program which will compute the gross pay, Social Security Tax, Income Tax and net pay for an employee. The program needs to prompt for and read the employ
how to fill the blank spaces in the board of 4*4 matrix with the minimum of 4 colors and the condition is the adjacent element should not have the same colour
c++ program
Write a program that keeps record of football results. Program stores following information about each match: Description Type and/or size name of home team max. 25 characters name
Debug the following program to calculate N! #include using namespace std; main() { int N, factorial=1; cout cin >> N;
Question : (a) (i) What is a structure member in C? What is the relationship between a structure member and the structure? (ii) How can structure variables be declared in C?
Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send
Question 1 Implement a class stack which simulates the operations of the stack allowing LIFO operations. Also implement push and pop operations for the stack 2 Explain the c
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