Question
Write a C++ program to demonstrate exception handling by using matrix multiplication operation. Matrix multiplication function should notify if the order of the matrix is invalid, using exception.
Answer :
Word Count : 192
_____ __________ _____ ___ ____.
__________ _______ ________ __________ ____ ______ ___ ___ _____ _____ ________ ____.
_________ ______ ______ _____ ____ ________ _____.
___ _________ ____ _____ _____ ___ ______ ________ ______.
____ __________ _____ _________ _________.
_________ ___ _____ __________ _________ _________ ________ __________ __________ _________ ___.
_______ __________ _____ _________ _____ __________ ________ _________ ________ __________.
___ __________ _____ _________ __________ ____ _________ ______.
___ _______ ________ ______ ________ ______ __________ ____ __________ ___ ______.
_____ ___ ____ _____ ______ ___ ___.
___ _________ ___ _________ _______.
_________ ____ ____ _______ ________ ____ ________ _______ ____ ________ _______.
___ ________ ________ _______ ___ _____ _____ ____.
___ _______ _______ _______ __________ ___ ____ _______ ______ __________ _______ _______.
__________ _________.
Skip in 10
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<exception.h>
void matsum()
{
int m, n, i, j, first[10][10], second[10][10], sum[10][10];
try
{
cout << "Enter the number of rows and columns of matrix ";
cin >> m >> n;
cout << "Enter the elements of first matrix\n";
if (m>10 || n>10)
//exit(0);
throw 1;
}
catch(int)
{
cout<<"subscript invalid";
}
for ( i = 0 ; i < m ; i++ )
for (
__________ _______ ________ __________ ____ ______ ___ ___ _____ _____ ________ ____.
_________ ______ ______ _____ ____ ________ _____.
___ _________ ____ _____ _____ ___ ______ ________ ______.
____ __________ _____ _________ _________.
_________ ___ _____ __________ _________ _________ ________ __________ __________ _________ ___.
_______ __________ _____ _________ _____ __________ ________ _________ ________ __________.
___ __________ _____ _________ __________ ____ _________ ______.
___ _______ ________ ______ ________ ______ __________ ____ __________ ___ ______.
_____ ___ ____ _____ ______ ___ ___.
___ _________ ___ _________ _______.
_________ ____ ____ _______ ________ ____ ________ _______ ____ ________ _______.
___ ________ ________ _______ ___ _____ _____ ____.
___ _______ _______ _______ __________ ___ ____ _______ ______ __________ _______ _______.
__________ _________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.