Advertisement
Madotsuki

euclid

Sep 10th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.17 KB | None | 0 0
  1. int GCD_finder ( int a, int b )
  2. {
  3.     if( b == 0 )
  4.         return( a );
  5.     else
  6.     {
  7.         int q, r;
  8.         divMod(a, b, &q, &r); // (q,r) = divMod a b
  9.         return ( GCD_finder(b, r) );
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement