-
What is the output of this program?
#include <iostream>
#include <exception>
using namespace std;
int main ()
{
try
{
int* myarray = new int[150];
cout << "Memory Allocated...";
}
catch (exception& e)
{
cout << "Standard Exception occurred..." << e.what() << endl;
}
return 0;
}
-
- Memory Allocated...
- Compilation Error
- Runtime Error
- Garbage Value
- None of these
Correct Option: A
In this program, We are allocating the memory for array. If it is allocated means, no exception will arise and if there is no size in memory means, Exception will arise.