Question
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
try
7.
{
8.
int* myarray = new int[1000];
9.
cout
What is the output of this program?
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
try
7.
{
8.
int* myarray = new int[1000];
9.
cout
Answer: Option C
Was this answer helpful ?
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.
Output:
$ g++ excep3.cpp
$ a.out
allocated
Was this answer helpful ?
More Questions on This Topic :
Question 4.
Which is used to throw a exception?
....
Question 5.
What is the use of the 'finally' keyword?
....
Submit Solution