LogiQuest
Back to OOPS Concepts
19

What will be the output of the program?

#include <iostream>
using namespace std;
struct S { int a = 3; };
class C { int a = 4; public: int get() { return a; } };
int main() {
    S s; C c;
    cout << s.a + c.get() << endl;
    return 0;
}
Medium

Discussion (0)

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

Log in to join the discussion.