\"The greatest common divisor of two integers is the largest integer that evenly divides each of the two numbers. Write method Gcd that returns the greatest common divisor o
Try this:
public static int GCD(int p, int q) { if(q == 0) { return p; } int r = p % q; return GCD(q, r); }