LearnPy Hub
← Loops problems
Medium

Greatest Common Divisor

Read two positive integers and print their GCD using Euclid's algorithm in a while loop.

Input

Two integers.

Output

The GCD.

Sample 1

Input
48
18
Output
6

Sample 2

Input
17
5
Output
1
solution.py
Output appears here
Greatest Common Divisor · Python practice problem · LearnPy Hub