What will be the output of the following C++ code?
#include <iostream>
#include <exception>
using namespace std;
int main ()
{
try
{
double* i= new double[1000];
cout << "Memory allocated";
}
catch (exception& e)
{
cout << "Exception arised: " << e.what() << endl;
}
return 0;
}
#include <iostream>
#include <exception>
using namespace std;
int main ()
{
try
{
double* i= new double[1000];
cout << "Memory allocated";
}
catch (exception& e)
{
cout << "Exception arised: " << e.what() << endl;
}
return 0;
}A. Memory allocated
B. Exception arised
C. Depends on the computer memory
D. Memory allocatedException arised
Answer: Option C

Join The Discussion