#include <stdio.h>
using namespace std;
int main()
{
int x = 5, y = 5, z;
x = ++x; y = --y;
z = x + ++x;
cout << z;
return 0;
}
Here's the complete corrected code that performs the described computation:
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
int x = 5, y = 5, z;
++x; --y;
z = x + (x + 1);
cout << z;
return 0;
}
The result is 13. (
http://codepad.org/n9uSsw2Z[
^])
Is that what you've actually needed ? Just post your comment.