Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x, y;
- try
- {
- cout << "Enter dividend and divisor respectively" << endl;
- if (y == 0)
- {
- throw y;
- cout << "After throw (Never executed) \n";
- }
- }
- catch (int x )
- {
- cout << "Can't Divide by 0" << endl;
- }
- cout<< "This will be executed";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement