Q132
What will be the output of the following C++ code? #include using namespace std; int main() int var = -12; try cout<<"Inside try "; if (var < 0) throw var; cout<<"After throw "; catch (char var ) cout<<"Exception Caught "; cout<<"After catch "; return 0;
A.
Inside try
Exception Caught
After catch
Exception Caught
After catch
B.
Inside try
After throw
After catch
After throw
After catch
C.
Error
D.
Run-time error
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board