According to the concept of pre-increment and post-increment operator the output of the following code should be (8+8) = 16, but in the compiler it is evaluated to 17. Please explain with steps.
#include <iostream>
using namespace std;
int main()
{
int n = 7;
int x = ++n + n++;
cout << x;
return 0;
}