int x = 7;
x = -x;
cout << "x is " << x << endl;
x = -x;
cout << "x is " << x << endl;
Will produce
x is -7
x is 7
int x = -7;
x = +x;
cout << "x is " << x << endl;
Will produce
x is -7
If I have 207 pennies, how many pennies would I have left if I traded
as many as I could in for dimes.
207 % 10 = 7
207 / 10 = 20
I wouild have 20 dimes and 7 pennies.
i = 3;
cout << i++;
i = 3;
cout << ++i;