Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
using namespace std;
4.
int main()
5.
{
6.
try {
7.
int * array1 = new int[100000000];
8.
int * array2 = new int[100000000];
9.
int * array3 = new int[100000000];
10.
int * array4 = new int[100000000];
11.
cout
Options:
A .  Allocated successfully
B .  error allocating the requested memory
C .  Depends on the memory of the computer
D .  none of the mentioned
Answer: Option C

In this program, we allocating the memory to the arrays by using excetion handling and 

we handled the exception by standard exception.
Output:
$ g++ excep5.cpp
$ a.out
Allocated successfully




Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers