Multiple Exception - Default Exception

#include <iostream>
using namespace std;
int main() {
int N;
  cin>>N;
  try
  {
    if (N==1)
      cout<<"Integer Exception\nException number=25";
    else if(N==2)
       cout<<"Float Exception\nException number=25.23";
    else
      throw(N);
  }
  catch(...)
  {
    cout<<"Default Exception\nWrong Number Used, Input 1 or 2";
  }
return 0;
}

3 comments: