Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
virtual void print() const = 0;
7.
};
8.
class DerivedOne : virtual public Base
9.
{
10.
public:
11.
void print() const
12.
{
13.
cout
Options:
A .  121
B .  212
C .  12
D .  None of the mentioned
Answer: Option B

In this program, We are executing these based on the condition given in array. So it is printing as 212.
Output:
$ g++ abs4.cpp
$ a.out
212



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers