1.

What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int num = -2;
char *p;
p = new char[50];
try
{
if (num < 0)
{
throw num;
}
if (p == NULL)
{
throw "p is NULL ";
}
}
catch (...)
{
cout << "Exception occurred: exiting"<< endl;
}
return 0;
}

A. Compilation Error
B. Runtime Error
C. p is NULL
D. Exception occurred: exiting
E. None of these
Answer» E. None of these


Discussion

No Comment Found

Related MCQs