adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    namespace Box1
    {
        int a = 4;
    }
    namespace Box2
    {
        int a = 13;
    }
    int main ()
    {
        int a = 16;
        Box1::a;
        Box2::a;
        cout << a;
        return 0;
    }

a.

4

b.

13

c.

16

d.

compile time error

Answer: (c).16

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?