GCD using Euclidean Algorithm iteratively
<p>For a class, I'm taking, I'm required to convert the following C++ code to MIPS assembly. 
The code computes the GCD of two positive integers using the Euclidean algorithm iteratively.</p>

<p>My MIPS assembly code works exactly as the given C++ code does, but I believe the C++ code is incorrect, because no matter what two integers I supply, the GCD is returned as 1.</p>

<pre><code>int gcd_iterative(int a, int b)
{
    int c;

    if ( b == 0 ) 
        return a;

    else
        while ( b != 0 )
        {
            c = b;
            b = a % b;
            a = c;
        }

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

<p>I've never worked with the Euclidean algorithm to calculate GCD so I'm not familiar with it and not sure where its going wrong.</p>
