Question: What would the following code print? #include using namespace std; namespace first { int x = 5; } namespace second { double x =

What would the following code print? #include using namespace std; namespace first

What would the following code print? #include using namespace std; namespace first { int x = 5; } namespace second { double x = 3.1416; } int main() { int x = 4; cout < < (x* first::x) < < ''; cout < < x < < ''; cout < < second::x < < endl; cout < < x < < endl; return 0; }

Step by Step Solution

3.40 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The first two cout statements would print 5 and 4 respectively The third cou... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Economics Questions!