-
What is the output of this program?
#include
using namespace std;
namespace first
{
int num = 5;
}
namespace second
{
int num = 11;
}
int main ()
{
int num = 27;
first::num;
second::num;
cout << num;
return 0;
}
-
- 27
- 11
- 25
- Compilation Error
- None of these
Correct Option: A
In this program, as there is lot of variable a and it is printing the value inside the block because it got the highest priority.