Input
Output
#include <iostream> #include <exception> using namespace std; class MyException : public exception{ public: const char * what() const throw() { return "User-Defined Exceptions !"; } }; int main() { try { throw MyException(); } catch(exception& e) { cout << e.what(); } }