Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
Base ( )
7.
{
8.
cout
Options:
A .  1234
B .  4321
C .  1423
D .  1342
Answer: Option D

In this program, We are printing the order of execution of constructor and destructor in the class.
Output:
$ g++ dert4.cpp
$ a.out
1342



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers