Home » C++ Programming » References » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int num = 11;
    int & numref = num;
    num++;
    cout << "The value of num is " << numref;
    return 0;
    }
    1. 12
    2. 11
    3. Garbage value
    4. Compilation Error
    5. Runtime Error
Correct Option: A

The value is declared and it isincrementedrement, so it’s value is 11.



Your comments will be displayed only after manual approval.