Home » C++ Programming » Operators » Question
  1. What is the output of this program?
    #include <iostream> 
    using namespace std;
    int main()
    {
    int num1 = 10, num2 = 12;
    cout << ++num1 <<" "<< --num2 << endl;
    return 0;
    }
    1. 10 12
    2. 12 10
    3. 11 11
    4. Compilation Error
    5. None of these
Correct Option: C

The values will be pre increment and pre decrement, So it will print as 11 11.



Your comments will be displayed only after manual approval.