Examveda

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
namespace Box1
{
    int a = 4;
}
namespace Box2
{
    int a = 13;
}
int main ()
{
    int a = 16;
    Box1::a;
    Box2::a;
    cout << a;
    return 0;
}

A. 4

B. 13

C. 16

D. compile time error

Answer: Option C


Join The Discussion

Related Questions on Functions and Procedures in C plus plus