Sail E0 Webinar
Question


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
Options:
A .  256
B .  invalid argument
C .  Error
D .  None of the mentioned
Answer: Option C

We can't return a statement by using the return keyword, So it is arising an error.



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers