public int gcd (int a, int b) { int mode = a % b; if(mode == 0) { return b; } return gcd(b, mode); }