Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous Difficulty: Medium

What will be the output of the following C++ code? #include <iostream> using namespace std; class sample { public: virtual void example() = 0; }; class Ex1:public sample { public: void example() { cout << "ubuntu"; } }; class Ex2:public sample { public: void example() { cout << " is awesome"; } }; int main() { sample* arra[2]; Ex1 e1; Ex2 e2; arra[0]=&e1; arra[1]=&e2; arra[0]->example(); arra[1]->example(); }

Select the correct option to test your answer:

More Computer Questions

What is true about do statement? Mahout provides . . . . . . . . libraries for common and primitive Java collections. What is the purpose of the `String.format()` method in Java? Which of the following is true about the trie? A dot-matrix printer