Question
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
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
Answer: Option B
Was this answer helpful ?
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 ?
Submit Solution