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

In this program, we are adding the num1 value after pre incrementing two times.



Your comments will be displayed only after manual approval.