1.

What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int num = -2;
try
{
if (num < 0)
{
throw num;
}
else
{
cout<< num;
}
}
catch (int num )
{
cout << "Exception occurred: Thrown value is " << num << endl;
}
return 0;
}

A. Compilation Error
B. Runtime Error
C. -2
D. Exception occurred: Thrown value is -2
E. None of these
Answer» E. None of these


Discussion

No Comment Found

Related MCQs