Skip to content

A simple java program that is based on the Euclidean Algorithm for finding the greatest common divisor of two numbers.

Notifications You must be signed in to change notification settings

thatBrian/Euclids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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

About

A simple java program that is based on the Euclidean Algorithm for finding the greatest common divisor of two numbers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages