#include #include using namespace std ; int main() { auto divide = [](int a, int b) -> int { if (b == 0) { throw runtime_error("Division by zero!"); } return a / b; }; try { int result = divide(10, 0); cout << "Result: " << result << endl; } catch (const runtime_error& e) { cerr << "Error: " << e.what() << endl; } auto divide1 = [](int a, int b) noexcept -> int { if (b == 0) { cout << "Divisor is zero. Can't divide." << endl ; return 0; } return a / b; }; auto divide2 = [](int a, int b) noexcept -> int { if (b == 0) { cout << "Divisor is zero. Can't divide." << endl ; throw runtime_error("Division by zero!"); } return a / b; }; }