What will be printed out as a result of the following code execution?
#include "stdio.h"

class Super1 {
  public:
    virtual void Count() { printf("%d", 1); }
};

class Super2 {
  public:
    virtual void Count() { printf("%d", 2); }
};

class Child : public Super1, public Super2 { 
  public:
    void Count() { printf("%d", 3); }
};

int main() {
  Super1 * obj = new Child;
  obj->Count();
  return 0;
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes