Assigning function to variable
<p>Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?</p>

<pre><code>#include &lt;iostream&gt;

int ReadNumber()
{
    using namespace std;
    cout &lt;&lt; "Enter a number: ";
    int x;
    cin &gt;&gt; x;
    return x;
}

void WriteAnswer(int x)
{
    using namespace std;
    cout &lt;&lt; "The answer is " &lt;&lt; x &lt;&lt; endl;
}

int main()
{
    int x = ReadNumber();
    int y = ReadNumber();
    WriteAnswer(x+y);
    return 0;
}
</code></pre>
