-
What is the output of this program?
#include
using namespace std;
namespace calc
{
int p = 12;
}
namespace calc
{
int q = 23;
}
int main(int argc, char * argv[])
{
calc::p = calc::q =6;
cout << calc::p << calc::q;
}
-
- 66
- 12
- 23
- 6
- None of these
Correct Option: A
We are overriding the value at the main function and so we are getting the output as 66.