title: program for finding Gcd in Prolog
body: <p>I tried to write a code in Prolog for finding GCD (without using modulo) 
  can anyone tell me what's wrong with this program? </p>
  
  <pre><code>gcd(X,Y,Z):- X&gt;=Y, X1=X-Y, gcd(X1,Y,Z).
  gcd(X,Y,Z):- X&lt;Y, X1=Y- X, gcd(X1,X,Z).
  gcd(0,X,X):- X&gt;0.
  </code></pre>