Loading repovive.com/problems/classics/8
The greatest common divisor (GCD) of two integers is the largest positive integer that divides both.
Given two integers a and b, compute gcd(a,b).
Note: gcd(0,n)=gcd(n,0)=n for any positive n.
ab
gcd(a,b)
12 8
For this input, the required output is 4.
4
17 13
For this input, the required output is 1.
1
100 25
For this input, the required output is 25.
25