Create your own exception class, derived from runtime_error. In main, code a try block and catch handler. In the try block throw an exception of the type you just created. Catch the exception in a catch handler and display the what() member function for the exception.