diff --git a/src/MyMath.java b/src/MyMath.java index 7da9a29..6bc01ac 100644 --- a/src/MyMath.java +++ b/src/MyMath.java @@ -1,7 +1,33 @@ +/** + * + * @author Trevor Hartman + * @author Cassandra Portlock + * + * @since Version 1 + * + */ + import java.util.Scanner; public class MyMath { + private final static Scanner s = new Scanner(System.in); + public static void gcf() { + System.out.print("Type first number to find greatest common factor: "); + int a = s.nextInt(); + + System.out.print("Type first number to find greatest common factor: "); + int b = s.nextInt(); + + while (b != 0) { + int c = a; + a = b; + b = c % b; + } + + System.out.printf("The Greatest Common Factor is: %s", a); + } public static void main(String[] args) { + gcf(); } }