What can you assume about the function called division not s
What can you assume about the function called division (not shown here)?
int main ()
{
try {
division();
}catch (const char* msg) {
cerr << msg << endl;
}
return 0;
}
Ans Choice:
1. This function may cause a runtime exception to occur. If an exception occurs, control will transfer to the catch
block to handle the exception.
2. This program may not compile. The try keyword will cause the compiler to skip everything in the try block if it
cannot be compiled.
3. This function may not be implemented, or the implementation may not be found. If so, control is transferred to
the catch block to alert the user that the code is incomplete.
Can you tell me the answer please thanks! Can be more than one choice
Solution
Ans)1
Reason:
when the code in the try block is getting executed if any run time exception is raised.the program will not terminate abruptly.If runtime time exception is raised control will come out of thetry block and control will transfer to the catch block to handle runtime exception.
