Calculating the Greatest Common Divisor and the Least Common Multiple

This program finds the greatest commond divisor of two nonzero integers a and b.
It writes the greatest common divisor of a and b as a linear combination of them.
It also finds the least common multiple of a and b.
The greatest common divisor of a and b will be denoted by gcd(a,b).
The least common multiple of a and b will be denoted by lcm(a,b).
Enter a (a nonzero integer):
Enter b (a nonzero integer):

Result
The greatest common divisor is:
The linear comination is (scroll right):
The least common multiple is:

Back to the Programs