post and pre increment, decrement in c++
<pre><code>#include &lt;iostream&gt;
using namespace std;

void f(int x, int y){

        cout &lt;&lt; "x is " &lt;&lt; x &lt;&lt; endl;
        cout &lt;&lt; "y is " &lt;&lt; y &lt;&lt; endl;
}



int main(){

        int i = 7;
        f(i--,i-- );
        cout &lt;&lt; i &lt;&lt; endl&lt;&lt; endl;
}
</code></pre>

<p>We expected the program to print "x is 7 \n y is 6 \n i is 5" </p>

<p>but the program printed "x is 6 \n y is 7 \n i is 5" </p>
