1.

What is the output of this program?
#include <iostream>
using namespace std;
void DivFunction(const double num1, const double num2);
int main()
{
double option1=20, option2=5;
try
{
DivFunction(option1, option2);
}
catch (const char* S)
{
cout << "Bad Operator caught: " << S;
}
return 0;
}
void DivFunction(const double num1, const double num2)
{
double Res;
if (num2 == 0)
throw "Division by zero not allowed";
Res = num1 / num2;
cout << Res;
}

A. Bad Operator caught
B. Division by zero not allowed
C. 10
D. 20
E. 4
Answer» F.


Discussion

No Comment Found

Related MCQs