![]() |
VOOZH | about |
public static int gcd(int a, int b) Where a and b are integers.Return Value : Greatest common divisor of integers a and b. Exceptions : The method gcd(int a, int b) throws IllegalArgumentException if a < 0 or b < 0. Example 1 :
GCD of a1 & b1 is: 4 GCD of a2 & b2 is: 1
java.lang.IllegalArgumentException: a (-5) must be >= 0