Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 19, 2019 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ad5f88dd1d5037bd524dc57ffe1a9192 to your computer and use it in GitHub Desktop.
Save parzibyte/ad5f88dd1d5037bd524dc57ffe1a9192 to your computer and use it in GitHub Desktop.
// Si quieres puedes usar la función de MCD recursiva: https://parzibyte.me/blog/2019/12/18/maximo-comun-divisor-c-algoritmo-euclides/
int maximo_comun_divisor(int a, int b) {
int temporal;//Para no perder b
while (b != 0) {
temporal = b;
b = a % b;
a = temporal;
}
return a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment