Home » C++ Programming » Interfaces » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    namespace calculation
    {
    int p;
    }
    void p()
    {
    using namespace calculation;
    int p;
    p = 15;
    cout << p;
    }
    int main()
    {
    enum letter { K, L};
    class K { letter L; };
    ::p();
    return 0;
    }
    1. Compilation Error
    2. Runtime Error
    3. Garbage value
    4. 15
    5. None of these
Correct Option: D

A scope resolution operator without a scope qualifier refers to the global namespace.



Your comments will be displayed only after manual approval.