C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 24 Topic 3 Discussion

C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 24 Topic 3 Discussion

CPA-21-02 Exam Topic 3 Question 24 Discussion:
Question #: 24
Topic #: 3

What happens when you attempt to compile and run the following code?

#include

using namespace std;

namespace myNamespace1

{

int x = 5;

int y = 10;

}

namespace myNamespace2

{

float x = 3.14;

float y = 1.5;

}

int main () {

namespace newname = myNamespace1;

using namespace newname;

cout << x << " ";

cout << y;

return 0;

}


A.

It prints: 5 1.5


B.

It prints: 3.14 1.5


C.

It prints: 5 10


D.

It prints: 5


Get Premium CPA-21-02 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.