Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
try
6.
{
7.
throw 1;
8.
}
9.
catch (int a)
10.
{
11.
cout
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
Answer: Option C
Was this answer helpful ?
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 ?
Submit Solution