Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 543 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 543 Bytes

Euclid's Algorithm

This project shows how th Euclidean algorithm calculates the greatest common divisor(GCD) of two numbers.

How to compile?

javac Euclids.java

How does it work?

This program takes in 2 arguments

  1. Input value one
  2. Input value two The output of the program will be "Input value one", "Input value two" along with its GCD. The program will also show the number of iterations used to find the GCD.

Example

./java Euclids 20 4

Sample Output

The GCD of 20 and 4 is 4

Calculated in 1 iterations