-
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;
}
-
- 7
- 3
- 17
- 18
- None of these
Correct Option: D
In this program, we are adding the num1 value after pre incrementing two times.