Different output on recursive call using static variable : <pre><code>int fun1(int x){
    static int n;
    n = 0;
    if(x &gt; 0){
        n++;
        return fun1(x-1)+n;
    }
    return 0;
}
int fun(int x){
    static int n = 0;
    if(x &gt; 0){
        n++;
        return fun(x-1)+n;
    }
    return 0;
}
</code></pre>

<p>Can anyone tell me the difference between fun and fun1 ?
Getting different output!!</p>
