Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int age = 0;
6.
try {
7.
if (age < 0) {
8.
throw "Positive Number Required";
9.
}
10.
cout
Options:
A .  0
B .  Error:Positive Number Required
C .  compile time error
D .  none of the mentioned
Answer: Option A

As the zero marks the beginning of the positive number, it is printed as output
Output:
$ g++ excep.cpp
$ a.out
0



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers