Multiple Choice
Given the following code, what will happen if the value of denom is 0?
double divide(int numer, int denom)
{
if (denom == 0)
throw "ERROR: Cannot divide by zero.\n";
else
Return static_cast<double>(numer) /denom;
}
A) Nothing will happen because there is no catch block.
B) The program will display ERROR: Cannot divide by zero.and then move to the statement following the if/else block.
C) The program will display ERROR: Cannot divide by zero.and then halt.
D) There is no throw point because there is no try block.
E) None of these
Correct Answer:

Verified
Correct Answer:
Verified
Q1: How much memory is reserved for a
Q3: A generic function that can work with
Q4: A function template's prefix contains _ enclosed
Q5: The line containing a throw statement is
Q6: When an error occurs, an exception is<br>A)
Q7: If an exception is not caught, it
Q8: A generic function that can work with
Q9: All type parameters defined in a function
Q10: When the _ operator fails to allocate
Q11: The _ starts with the key word