Saturday 18 November 2017

C++ Program to Check Multiplicability of Two Matrices


Code:

#include     conio.h
#include     iostream
#include     math.h

using namespace std;

int main(int argc, char **argv)
{
    cout<<"Enter the dimension of the matrix:\n ";
    int rowA;cin>>rowA;
    int colA;cin>>colA;

    cout<<"Enter the dimension of the other matrix:\n ";
    int rowB;cin>>rowB;
    int colB;cin>>colB;

    if(colA == rowB)
    {
        cout<<"Matrices are multipilcable";
    }
    else
    {
        cout<<"Matrices are not multipilcable";
    }
}


Output:

Enter the dimension of the matrix:
 2 4
Enter the dimension of the other matrix:
 2 5
Matrices are not multipilcable

Enter the dimension of the matrix:
 4 5
Enter the dimension of the other matrix:
 5 6
Matrices are multipilcable


More C++ Programs:















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...