Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

What will be the output of the following code segment? - Select option

  Shared By: Luisa Fischer    Date: Oct 15    Category: C++ Programming    Views: 2116

Answer:

void function();
int main()
{
try
{
function();
}
catch (char)
{
cout<<"Caught a Char<<endl";
}
return 0;
}
void function()
{
throw 2;
}
}

Options

a) Error in execution
b) Caught a Char
c) Abort() function is invoked
d) None of the above

Answer : c) Abort() function is invoked

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: