Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

C++ Programming :: Namespaces - Discussion

Home > C++ Programming > Namespaces > MCQs Questions Discussion

6 / 12

What is the output of the below C++ program?

#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;
        }

A4

B13

C16

DCompilation Error

Answer: Option (Login/Signup)

Show Explanation

Asked In :: Societe Generale

Post Your Answer Here:     

No Discussion on this question yet!