adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std
    namespace space
    {
        int x = 10;
    }
    namespace space
    {
        int y = 15;
    }
    int main(int argc, char * argv[])
    {
        space::x = space::y =5;
        cout << space::x << space::y;
    }

a.

1015

b.

1510

c.

55

d.

compile time error

Answer: (c).55

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?