Sail E0 Webinar
Question


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
Options:
A .  50
B .  0
C .  Division by zero condition
D .  Error
Answer: Option D

As we missed the data type in the catch block, It will arise an error.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers