// exceptions #include using namespace std; int main () { int value = 3; cout << "Enter in a number from 0 to 3 to throw different types of exceptions" << endl; cin >> value; cout << "Before try, value = " << value << endl; try { cout << "Before throw" << endl; if (value == 0) throw 20; if (value == 1) throw 5.5; if (value == 2) throw true; if (value == 3) throw 'c'; cout << "After throw" << endl; } catch (int e) { cout << "An int exception occurred. Exception Nr. " << e << endl; } catch (double e) { cout << "An double exception occurred. Exception Nr. " << e << endl; } catch (bool e) { cout << "An bool exception occurred. Exception Nr. " << e << endl; } catch (...) { cout << "An ellipse exception occurred. " << endl; } cout << "after catch" << endl; return 0; }