#include <iostream>
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()
{
int a = 12 , b = 20;
std::cout << "The GCD (greatest common divisor) of " << a << " and " << b << " is: " << getGCD_Recursion(a, b);
return 0;
}
/*
run:
The GCD (greatest common divisor) of 12 and 20 is: 4
*/