Q62
What will be the output of the following C++ code? #include #include #include using namespace std; void func(int a, int b) if(b < 1) throw b; else cout<<"Product of "<<a<<" and "<<b<<" is: "<<a*b<<endl; int main() try try func(5,-1); catch(int b) if(b==0) throw "value of b is zero "; else throw "value of b is less than zero "; catch(const char* e) cout<<e;
A.
value of b is zero
B.
value of b is less than zero
AnswerC.
Product of 5 and -1 is: -5
D.
Aborted(core dumped)
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board