Skip to content

Instantly share code, notes, and snippets.

@Nick3523
Created March 7, 2020 13:17
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 Nick3523/e3addcd59de93c14fc11c924f9d7f33a to your computer and use it in GitHub Desktop.
Save Nick3523/e3addcd59de93c14fc11c924f9d7f33a to your computer and use it in GitHub Desktop.
#include <stdio.h>
int pgcd(int a, int b) {
while(b != 0) {
int tmp = b;
b = a % b;
a = tmp;
}
return a;
}
int main() {
int a = 50;
int b = 62;
int res = pgcd(a,b);
printf("Le pgcd de %i et %i est %i ",a, b, res);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment