1.

What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int a = 8;
try
{
if (a < 0)
throw "Positive Number Required";
cout << a << " n n";
}
catch(const char* Msg)
{
cout << "Error: " << Msg;
}
return 0;
}

A. Positive Number Required
B. 8
C. Compilation Error
D. Runtime Error
E. None of these
Answer» C. Compilation Error


Discussion

No Comment Found

Related MCQs