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