greatest common divisor implementation code for numbers : cpp code
#include <stdio.h>
int euclid(int a,int b) { if(b==0) return a; else return euclid(b,a%b); }
int main() { int n1,n2; printf("Enter two numbers to find its GCD:"); scanf("%d %d",&n1,&n2); printf("The GCD of %d and %d is %d\n",n1,n2,euclid(n1,n2)); return 0; }
_________________ M. S. Rakha, Ph.D. Queen's University Canada