1.

What is the output of this program?
#include <iostream>
#include <exception>
using namespace std;
class NewExcep: public exception
{
virtual const char* what() const throw()
{
return "New exception occurred...";
}
} NewExcep;
int main ()
{
try
{
throw NewExcep;
}
catch (exception& excep)
{
cout << excep.what() << endl;
}
return 0;
}

A. Exception
B. Compilation Error
C. New exception occurred...
D. Runtime Error
E. None of these
Answer» D. Runtime Error


Discussion

No Comment Found

Related MCQs