public static void main( String[] args ){
long num1 = 100;
long num2 = 8;
gcd( num1, num2 );
public static long gcd( long a, long b )
System.out.println( "gcd("+a+","+b+")");
if( b == 0 )
else
gcd( b, a % b );
public static long gcd( long a, long b )
System.out.println( "gcd("+a+","+b+")");
if( b == 0 )
else
gcd( b, a % b );
public static long gcd( long a, long b )
System.out.println( "gcd("+a+","+b+")");
if( b == 0 )
return a;
return gcd( b, a % b );
return gcd( b, a % b );
long result = gcd( num1, num2 );
System.out.println("gcd("+num1+","+num2+")="+result+" (in main)\n");