public class GCD { public static void main (String[] args) { if (args.length != 2) System.err.println("Usage: GCD integer1 integer2"); else System.out.println( "The greatest common divisor of " + args[0] + " and " + args[1] + " is " + gcd(Integer.parseInt(args[0]), Integer.parseInt(args[1]))); } static int gcd (int a, int b) { System.out.println("a= " + a + " b= " + b); if (b < a) return gcd(b, a); if (b % a == 0) return a; else return gcd(b, b % a); } }