How can i write all the procedure that happens in euclidean algorithm for fiding GCD in C#?
<p>I have this </p>

<pre><code>public int GCD(int a, int b)
{
    while (a != 0 &amp;&amp; b != 0)
    {
        if (a &gt; b)
            a %= b;
        else
            b %= a;
    }

    if (a == 0)
        return b;
    else
        return a;
}
</code></pre>

<p>But I want all the procedure like <code>892=2*438+16</code> then <code>438=27*16+6</code> and so on.</p>
