int main()
{
int err = -99;
cout << "Before try
";
try {
cout << "Inside try
";
if (err < 0)
{
throw err;
cout << "After throw (Never executed)
";
}
}
catch (int err ) {
cout << "Exception Occured!
";
}
cout << "After catch (Will be executed)
";
return 0;
}