1.

What is the output of this program?
 #include 
#include
using namespace std;
int main()
{
try
{
int * arr1 = new int[100000000];
int * arr2 = new int[100000000];
int * arr3 = new int[100000000];
int * arr4 = new int[100000000];
cout << "Memory Allocated successfully";
}
catch(bad_alloc&)
{
cout << "Error allocating the requested memory." << endl;
}
return 0;
}

A. Depends on the memory of the computer
B. Allocated successfully
C. Error allocating the requested memory
D. All of above
E. None of these
Answer» B. Allocated successfully


Discussion

No Comment Found

Related MCQs