Home / MCQ Bank / Computer
Computer Exception Handling In C Plus Plus Difficulty: Medium

What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using namespace std; void func(int a, int b) { if(b == 0){ throw "This value of b will make the product zero. " "So please provide positive values.\n"; } else{ cout<<"Product of "<<a<<" and "<<b<<" is: "<<a*b<<endl; } } int main() { try{ func(5,0); } catch(const char* e){ cout<<e; } }

Select the correct option to test your answer:

More Computer Questions

Which of the following Microsoft-introduced property defines the position of underlining set by the text-decoration property? What does the 'strcmp' function in C do? Select the macro that affects the information provided by localeconv function. In database table, what does a column represent? Which statement can be used to specify the sql_mode system variable at runtime?