Skip to content

Instantly share code, notes, and snippets.

@jsharf
Created July 13, 2012 19:23
Show Gist options
  • Save jsharf/3106820 to your computer and use it in GitHub Desktop.
Save jsharf/3106820 to your computer and use it in GitHub Desktop.
Greatest Common Divisor function (one-line recursive implementation)
int gcd(int a, int b)
{
return (a%b==0)?b:gcd(b,a%b); //Jacob
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment