iterative greatest common divisor GCD
#include <iostream>
using namespace std;
long long gcd(long long m, long long n) {
while ( m != 0) {
long long old_m = m;
m = n % m;
n = old_m;
}
return abs(n);
}
int main() {
cout << gcd(2672, 5678) << endl;
}