Which of the following is an exception in C++?

a) Divide by zero
b) Semicolon not written
c) Variable not declared
d) An expression is wrongly written

1 thought on “Which of the following is an exception in C++?”

  1. a
    Explanation: Exceptions are those which are encountered during run-time of the program. semicolon, variable not declared and the wrong expression are compile-time errors, therefore, they are not exceptions. Divide by zero is the problem that is encountered during run-time, therefore, it is an exception.

Leave a Comment