Same algorithm implementation has different retults in Python and C++?
<p>This python code works properly and produces proper output:</p>

<pre><code>def fib(x):
    v = 1
    u = 0
    for x in xrange(1,x+1):
        t = u + v
        u = v
        v = t
    return v
</code></pre>

<p>But when I write the same code in C++ it gives me a different and impossible result.</p>

<pre><code>int fib(int x)
{
    int v = 1;
    int u = 0;
    int t;
    for (int i = 1; i != x + 1; i++)
    {
        t = u + v;
        u = v;
        v = t;
    }
    return v;
}
</code></pre>

<p>I'm still learning c++.
Thanks!</p>

<p>Edit: C++ outputs -1408458269. <br>
Python outputs 20365011074 when x = 50.</p>
