Question
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
int i, n;
7.
int * p;
8.
i = 2;
9.
p= new (nothrow) int[i];
10.
if (p == 0)
11.
cout
What is the output of this program?
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
int i, n;
7.
int * p;
8.
i = 2;
9.
p= new (nothrow) int[i];
10.
if (p == 0)
11.
cout
Answer: Option B
Was this answer helpful ?
As we had given i value as 2, It will print the 5 for two times.
Output:
$ g++ res.cpp
$ a.out
55
Was this answer helpful ?
Submit Solution