#include <stdio.h>
int getGCD_Recursion(int a, int b) {
while (a != b) {
if (a > b) {
return getGCD_Recursion(a - b, b);
}
else {
return getGCD_Recursion(a, b - a);
}
}
return a;
}
int main(void)
{
int a = 12, b = 20;
printf("The GCD (greatest common divisor) of %d and %d is: %d\n", a, b, getGCD_Recursion(a, b));
return 0;
}
/*
run:
The GCD (greatest common divisor) of 12 and 20 is: 4
*/