Show the output of the following code.

```
#include
using namespace std;

class Parent
{
public:
Parent()
{
cout << "Parent’s no-arg constructor is invoked" << endl;
}

~Parent()
{
cout << "Parent’s destructor is invoked" << endl;
}
};

class Child: public Parent
{
public:
Child()
{
cout << "Child’s no-arg constructor is invoked" << endl;
}

~Child()
{
cout << "Child’s destructor is invoked" << endl;
}
};

int main()
{
Child c1;
Child c2;

return 0;
}
```


Parent’s no-arg constructor is invoked
Child’s no-arg constructor is invoked
Parent’s no-arg constructor is invoked
Child’s no-arg constructor is invoked
Child’s destructor is invoked
Parent’s destructor is invoked
Child’s destructor is invoked
Parent’s destructor is invoked

Computer Science & Information Technology

You might also like to view...

Suppose we have the following definitions and assignments:

``` double *p, v; p = &v; // p gets the address of v What is the effect of this assignment? *p = 99.99 ```

Computer Science & Information Technology

In the accompanying figure, there are four line segments.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Specifying the number of decimal places and the special characters to display in a number is called ____.

A. formatting B. concatenating C. shredding D. designing

Computer Science & Information Technology

You can use the workspace switcher on the Menu bar to switch from one workspace to another.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology