In the following code, which statement is the throw point?
double divide(int numer, int denom)
{
If (denom == 0)
throw "ERROR: Cannot divide by zero.\n";
else
return static_cast<double>(numer) /denom;
}
A) if (denom == 0)
B) throw "ERROR: Cannot divide by zero.\n";
C) return static_cast<double>(numer) /denom;
D) There is no throw point because there is no try block.
E) None of these
Correct Answer:
Verified
Q12: There is no difference between declaring an
Q13: Using a function template requires less code
Q14: If an exception is thrown by a
Q15: Given the following code, what will
Q16: The line containing a throw statement is
Q18: Exceptions are used to signal errors or
Q19: The _ starts with the key word
Q20: A program may not contain both a
Q21: If you want to catch a bad_alloc
Q22: All type parameters defined in a function
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents