1.

What is the output of this program?
#include <iostream>
using namespace std;
double Div(int num1, int num2)
{
if (num2 == 0)
{
throw "Division by zero condition!";
}
return (num1 / num2);
}
int main ()
{
int p = 25;
int q = 0;
double Res = 0;
try
{
Res = Div(p, q);
cout << Res << endl;
}
catch (const Message)
{
cerr << Message << endl;
}
return 0;
}

A. Compilation Error
B. 25
C. Runtime Error
D. Division by zero condition!
E. None of these
Answer» B. 25


Discussion

No Comment Found

Related MCQs