title: How to get my code to show all mathematical steps in C
body: <p>I wrote this code to find the GCD of 2 whole numbers using Euclid's algorithm but I want to show the steps it's doing when I run it. Is that possible, if so how should I modify what I've already done. Thank you!</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int
  GCD (int a, int b)
  {
    if (a == b)
      {
        return a;
      }
    else
      {
        if (a &gt; b)
      return GCD (a - b, b);
  
        else
      return GCD (a, b - a);
      }
  }
  
  int
  main ()
  {
    int a, b;
    printf
      (&quot;Please enter 2 numbers separated by a comma: &quot;);
    scanf (&quot;%d,%d&quot;, &amp;a, &amp;b);
    int GCD (int a, int b);
    printf (&quot;\nGCD of %d and %d is %d&quot;, a, b, GCD (a, b));
    return 0;
  }
  </code></pre>