Live quiz

cpp - Part 53

Question 1 of 25 Hints left: 3
Q1

What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; class A { float d; public: virtual void func(){ cout<<"Hello this is class A\n"; } }; class B: public A { int a = 15; public: void func(){ cout<<"Hello this is class B\n"; } }; int main(int argc, char const *argv[]) { A *a; a->func(); return 0; }

  • A
  • B
  • C
  • D