-
What is the output of this program?
#include
using namespace std;
int main()
{
int num = 20;
try
{
if (num != 20)
{
throw "Positive Number Required";
}
cout << num;
}
catch(const char *Msg)
{
cout << "Error: " << Msg;
}
return 0;
}
-
- Compilation Error
- Runtime Error
- Garbage value
- error:Positive Number Required
- None of these
Correct Option: D
As the zero marks the beginning of the positive number, it is printed as output