Home » C++ Programming » Interfaces » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    namespace One
    {
    int num = 12;
    }
    namespace Two
    {
    double num = 10.027;
    }
    int main ()
    {
    int n;
    n = One::num + Two::num;
    cout << n;
    return 0;
    }
    1. 22
    2. 12
    3. 10.027
    4. 22.027
    5. None of these
Correct Option: A

As we are getting two variables from namespace variable and we are adding that.



Your comments will be displayed only after manual approval.