Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous

What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int a = 10, b = 20, c = 30; float d; try { if ((a - b) != 0) { d = c / (a - b); cout << d; } else { throw(a - b); } } catch (int i) { cout<<"Answer is infinite "<<i; } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • -3

Related Computer Questions

Which method is used to close the WebSocket? Which of the following cannot be static in C? Which of the following adds checkmark icon inside input? What is the result of the expression 3 * (4 + 2) in C? Which of the following protocols allows a workstation to dynamically access mail drops on a server host in a useful manner?