Implement Euclids GCD algorithm as a full class named Euclid. Recall the basics of the algorithm: For

Question:

Implement Euclid’s GCD algorithm as a full class named Euclid. Recall the basics of the algorithm: 

int a = 2701; int b = 222; while (b!= 0) { if (a > b) { b; } a = a } else { } b = b = a;

For your output, can you think of a way to show the user the original values of a and b in addition to the common denominator? The ideal output would look something like this:

% java Euclid The GCD of 2701 and 222 is 37

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: