Why is my program is outputting '0' when run, even though it is not supposed too? : <p>I am quite new to c++, and was just playing around with if statements, so I made this program:</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
int getMax(int num1, int num2){

    if (num1&gt;num2)
    {
        cout &lt;&lt; num1 &lt;&lt;endl;
    }else{
        cout &lt;&lt; num2 &lt;&lt;endl;
    }
    return EXIT_SUCCESS;
}

int main(){
    cout&lt;&lt;getMax(7,13)&lt;&lt;endl;

    return 0;
}
</code></pre>

<p>My getMax function takes two parmeters and is supposed to output the greater of the 2 numbers — in this case 13. But instead of only outputting 13, it also outputs 0. Why is this happening?</p>
