Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
try
6.
{
7.
throw 1;
8.
}
9.
catch (int a)
10.
{
11.
cout
Options:
A .  No exception
B .  exception number
C .  exception number: 1
D .  none of the mentioned
Answer: Option C

If we caught a integer value means, there will be an exception, if it is not a integer, there will 

not be a exception.
Output:
$ g++ gex1.cpp
$ a.out
exception number: 1



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers