Write a program that asks the user to enter two positive integers and then calculates their greatest common divisor (GCD).
If you enter the numbers 4 and 2, their greatest common divisor is 2. If you enter the numbers 16 and 24, their greatest common divisor is 8.
You know that the number 1 is always a common divisor, but it may not be the greatest. Therefore, you can check whether a number k (for k = 2, 3, 4, …) is a common divisor of both numbers until k becomes greater than one of the numbers.
The text in red represents user input and is not printed by your program.
Enter number 1? 69 Enter number 2: 36 Greatest Common Divisor is 3