-
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 = 40;
int q = 0;
double R = 0;
try
{
R = Div(p, q);
cout << R << endl;
}
catch (const char* Message)
{
cerr << Message << endl;
}
return 0;
}
-
- 40
- Division by zero condition!
- Compilation Error
- Runtime Error
- None of these
Correct Option: B
NA