Q17 Write a function to compute the greatest common divisor given by Euclid’s algorithm, exemplified for J=1980, K=1617 as follows: Thus, the greatest common divisor is 33.
Program: 138
Write a C function to compute the greatest common divisor given by Euclid’s algorithm, exemplified for J=1980, K=1617 as follows:
1980/1617=1 1980-1*1617=363
1617/363=4 1617-4*363=165
363/165=2 363-2*165=33
5/33=5 165-5*33=0
Thus, the greatest common divisor is 33.
Output:
Enter the value of a: 1980 Enter the value of b: 1617 Greatest Common Divisor of (1980, 1617): 33