Question: Why will the following code not compile? ` ` ` namespace ns 1 { void print ( ) ; void display 1 ( ) {

Why will the following code not compile?
```
namespace ns1
{
void print();
void display1(){};
}
namespace ns2
{
void print();
void display 2(){};
}
int main()
{
using namespace ns1;
using namespace ns2;
display 1();
display 2();
print();
return 0;
}
```
The call to print is ambiguous.
We have not included the iostream library.
We have not used namespace std.
It will compile.
Why will the following code not compile? ` ` `

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!