SHARE
TWEET

Untitled

a guest Jun 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int x, y;
  7.    
  8.     try
  9.     {
  10.         cout << "Enter dividend and divisor respectively" << endl;
  11.         if (y == 0)
  12.         {
  13.             throw y;
  14.             cout << "After throw (Never executed) \n";
  15.         }
  16.    }
  17.    catch (int x )
  18.    {
  19.        cout << "Can't Divide by 0" << endl;
  20.    }
  21.    
  22.     cout<< "This will be executed";
  23.    return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top