1.

What is the output of this program?
#include <iostream>
using namespace std;
void Example(int n)
{
try
{
if (n > 0)
throw n;
else
throw 'L';
}
catch(char)
{
cout << "Catch a integer and that integer is :" << n;
}
}
int main()
{
cout << "Testing multiple catches :";
Example(5);
Example(0);
}

A. Catch a integer and that integer is : 5
B. Compilation Error
C. Testing multiple catches :
D. Runtime Error
E. None of these
Answer» D. Runtime Error


Discussion

No Comment Found

Related MCQs