Link to home
Start Free TrialLog in
Avatar of debby76
debby76

asked on

gcd

I need help writing d gcd method, can someone give me some hints?  here is what i got so far:

**********************

public abstract int gcd (int a, int b) {
      
            if  (a == 0) {
                  gcd = 0;
            }
            else if ( (a % b) == 0) {
                  gcd = b;      
            }
            else if ( (a/b) == (1/2)) {
                  gcd = a;
            }
            
            
                  return gcd;
                  System.out.println (gcd);
ASKER CERTIFIED SOLUTION
Avatar of _lychee_
_lychee_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial