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 ;
___ ________ ____ ________ ___ ________.
____ ________ ________ _____ _____ ___ __________.
_________ __________ ___ ________ ___ _______ ________.
_______ _____ ________ ______ ________ __________ ________ __________ ______ _______ ____ ________.
_________ _________ ______ _________ __________ _____ _________.
_________ _________ _______ _______ ________ __________ __________ ___ _______ ________.
_______ _____ _______ _________ _________ ________ _________ ________ __________ _________ _______ ____.
______ ____ ________ ________ ________ ___ ______ ______.
_________ _____ ________ _________ ________ _____ _______ ________ _________ _______ __________.
____ ______ __________ __________ ________ ___ __________ ___ ______.
____ _____ ______ __________ __________ _________ _______ _____ ________ __________ ________.
_________ _________ __________ ___ ___ __________ __________.
_____ _________ _________ ______ _______ __________ ________ _________.
__________ ________ ______ ____.
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.