Why is the second output 6?
<pre><code>void addOne(int &amp;y)
{
    y = y + 1;
}

int main()
{
    int x = 5;
    std::cout &lt;&lt; "x = " &lt;&lt; x &lt;&lt; '\n';
    addOne(x);
    std::cout &lt;&lt; "x = " &lt;&lt; x &lt;&lt; '\n';
    return 0;
}
</code></pre>

<p>Sorry if this is a basic question. But why does y = y + 1 is 6?</p>