You are on page 1of 1

Le PGCD

#include <stdio.h> #include <stdlib.h> #include <string.h> long pgcd (long a, long b) { long r; while (b > 0) { r = a % b; a = b; b = r; } return a;

} int main() { int a,b; printf("donnez deux nombres :"); scanf("%d %d",&a,&b); printf("le pgcd est : %d",pgcd(a,b)); return 0; }

You might also like