-
What is the output of this program?
#include <iostream>
using namespace std;
class ClassA
{
public:
virtual void example() = 0;
};
class ClassB:public ClassA
{
public:
void example()
{
cout << "Interview Mania";
}
};
class ClassC:public ClassA
{
public:
void example()
{
cout << " is awesome.";
}
};
int main()
{
ClassA* array[2];
ClassB B;
ClassC C;
array[0]=&B;
array[1]=&C;
array[0]->example();
array[1]->example();
}
-
- Interview Mania
- Interview Mania is awesome.
- is awesome.
- Compilation Error
- None of these
Correct Option: B
In this program, We are combining the two statements from two classes and printing it by using abstract class.