Question
1.
#include
2.
#include
3.
#include
4.
using namespace std;
5.
void MyFunc(char c)
6.
{
7.
if (c < numeric_limits::max())
8.
return invalid_argument;
9.
}
10.
int main()
11.
{
12.
try
13.
{
14.
MyFunc(256);
15.
}
16.
catch(invalid_argument& e)
17.
{
18.
cerr
What is the output of this program?
1.
#include
2.
#include
3.
#include
4.
using namespace std;
5.
void MyFunc(char c)
6.
{
7.
if (c < numeric_limits::max())
8.
return invalid_argument;
9.
}
10.
int main()
11.
{
12.
try
13.
{
14.
MyFunc(256);
15.
}
16.
catch(invalid_argument& e)
17.
{
18.
cerr
Answer: Option C
Was this answer helpful ?
We can't return a statement by using the return keyword, So it is arising an error.
Was this answer helpful ?
Submit Solution