#include <iostream>

using namespace std;

int division(int x, int y)

 {

   if( y == 0 )

 {

      throw (0);

   }

   return (x/y);

}

int main () 

{

   int a,b,c;

 cout<<" enter 2 values";

 cin>>a>>b;

   try

 {

      c = division(a,b);

      cout << "Answer is: " << c   << endl;

   } 

  catch (int  i)

  {

     cout <<"Division by zero condition!" << endl;

   }

   return 0;

}

output 1:

enter 2 values

12 0

Division by zero condition!

output 2:

enter 2 values
100
5
Answer is: 20