DivisorCalc -...

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

View Full Document Right Arrow Icon
//******************************************************************** // DivisorCalc.java Author: Lewis/Loftus // // Solution to Programming Project 11.2 // // Contains a static method to calculate the greatest common // divisor of two positive integers.
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 class DivisorCalc { public static int gcd(int num1, int num2) { if (num2 % num1 == 0) return num1; else return gcd(num2, num1 % num2); } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online