1.

What is the output of this program?
#include <iostream>
using namespace std;
double DivFunction(int num1, int num2)
{
if ( num2 == 0 )
{
throw "Division by zero condition Occurred...";
}
return (num1 / num2);
}
int main ()
{
int m = 10;
int n = 0;
double Res = 0;
try
{
Res = DivFunction(m, n);
cout << Res << endl;
}
catch (const char* msg)
{
cout << msg << endl;
}
return 0;
}

A. Compilation Error
B. Runtime Error
C. Division by zero condition Occurred...
D. Garbage value
E. None of these
Answer» D. Garbage value


Discussion

No Comment Found

Related MCQs