#include <iostream>#include <stdexcept>using namespace std;//any method can throw an exceptionvoid methodWithException() { throw runtime_error("test exception");}try { methodWithException();}catch (runtime_error & e) { cout << e.what();}