Question
1.
#include
2.
using namespace std;
3.
double division(int a, int b)
4.
{
5.
if (b == 0)
6.
{
7.
throw "Division by zero condition!";
8.
}
9.
return (a / b);
10.
}
11.
int main ()
12.
{
13.
int x = 50;
14.
int y = 0;
15.
double z = 0;
16.
try
17.
{
18.
z = division(x, y);
19.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
double division(int a, int b)
4.
{
5.
if (b == 0)
6.
{
7.
throw "Division by zero condition!";
8.
}
9.
return (a / b);
10.
}
11.
int main ()
12.
{
13.
int x = 50;
14.
int y = 0;
15.
double z = 0;
16.
try
17.
{
18.
z = division(x, y);
19.
cout
Answer: Option D
Was this answer helpful ?
As we missed the data type in the catch block, It will arise an error.
Was this answer helpful ?
Submit Solution