Write a C++ program which use try and catch for exception handling. code example
Example: C++ try catch
try {
//do something
} catch (const std::exception& e) {
std::cout << e.what(); // information from error printed
}
try {
//do something
} catch (const std::exception& e) {
std::cout << e.what(); // information from error printed
}