Fig02_10 - public static void main( String [ ] args ) {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Fig02_10 { /* START: Fig02_10.txt*/ public static long gcd( long m, long n ) { /* 1*/ while( n != 0 ) { /* 2*/ long rem = m % n; /* 3*/ m = n; /* 4*/ n = rem; } /* 5*/ return m; } /* END */ / // Test program
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public static void main( String [ ] args ) { System.out.println( "gcd( 45, 35 ) = " + gcd( 45, 35 ) ); System.out.println( "gcd( 1989, 1590 ) = " + gcd( 1989, 1590 ) ); } }...
View Full Document

Ask a homework question - tutors are online