-
What is the output of this program?
#include <iostream>
using namespace std;
void Example() throw()
{
cout << "In empty()" << endl;
}
void WithTypeFunction() throw(int)
{
cout << "Will throw an int" << endl;
throw(1);
}
int main()
{
try
{
Example();
WithTypeFunction();
}
catch (int)
{
cout << "Caught an int" << endl;
}
}
-
- Caught an int
- In empty()
- Will throw an int
- All of above
- None of these
Correct Option: D
It will print all three because we are calling all functions in the main().