LogiQuest
Back to Inheritance
11

What will be the output of the program?

#include <iostream>
using namespace std;
class A { public: int v = 1; };
class B : public A {};
class C : public B {};
int main() {
    C c;
    cout << c.v << endl;
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.