1.

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();
}

A. Interview Mania
B. Interview Mania is awesome.
C. is awesome.
D. Compilation Error
E. None of these
Answer» C. is awesome.


Discussion

No Comment Found

Related MCQs