Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
int m;
7.
Base(int n=0)
8.
: m(n)
9.
{
10.
cout
Options:
A .  10 100
B .  100 10
C .  10 10
D .  100 100
Answer: Option A

Answer:a
Explanation: 
In this program, We are printing the execution order of the program.
Output:
$ g++ der2.cpp
$ a.out
Instantiating Base
Base
Instantiating Derived
Base
Derived



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers