Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
#include
4.
using namespace std;
5.
void func(int c)
6.
{
7.
if (c < numeric_limits :: max())
8.
throw invalid_argument("MyFunc argument too large.");
9.
else
10.
{
11.
cout
Options:
A .  Invalid arguments
B .  Executed
C .  Error
D .  Runtime error
Answer: Option B

As we are throwing the function and catching it with a correct data type, So this program will execute.
Output:
$ g++ expef.cpp
$ a.out
Executed



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers