#include #include using namespace std; int GetNumber(string prompt); int GCD(int a, int b); int main() { int a,b; a = GetNumber("Enter a positive integer => "); b = GetNumber("Enter a second positive integer => "); cout << "The GCD of " << a << " and " << b << " is " << GCD(a,b) << endl; return 0; } int GetNumber(string prompt) { int a; cout << prompt; cin >> a; return a; } int GCD(int a, int b) { if (b > a) { return GCD(b,a); } else if (b == 0) { return a; } else { return GCD(b, a%b); } }