My Blog
Articles related to programming, computer science, technology and research.

CPP program to rethrow an exception

31/03/2017 Categories: Exception Handling. 1 Comment on CPP program to rethrow an exception

A C++┬áprogram to rethrow an exception. Program is as follows: #include <iostream> using namespace std; int main() { try { int a, b; cout<<“Enter two integer values: “; cin>>a>>b; try { if(b == 0) { throw b; } else { cout<<(a/b); } } catch(…) { throw; //rethrowing the exception } } catch(int) { cout<<“Second value […]

Read the rest of this entry »

CPP program for handling divide by zero exception

31/03/2017 Categories: Exception Handling. 2 Comments on CPP program for handling divide by zero exception

A C++ program for handling divide by zero exception. Program is as follows:

Input and output for the above program are as follows:

 

Read the rest of this entry »
Scroll Up