Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class MyInterface
4.
{
5.
public:
6.
virtual void Display() = 0;
7.
};
8.
class Class1 : public MyInterface
9.
{
10.
public:
11.
void Display()
12.
{
13.
int a = 5;
14.
cout
Options:
A .  5
B .  10
C .  5 5
D .  None of the mentioned
Answer: Option C

In this program, We are displaying the data from the two classes
by using abstract class.
Output:
$ g++ abs1.cpp
$ a.out
5 5



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers