1.

What is the GCD of 20 and 12 using Euclid’s algorithm?(a) 8(b) 2(c) 4(d) 6This question was addressed to me in final exam.The doubt is from Number Theory in portion Number Theory of Data Structures & Algorithms II

Answer»

The CORRECT ANSWER is (c) 4

Explanation: GCD(m,n)=GCD(n, m MOD n)

GCD(20,12)=GCD( 12,8)

= GCD(8,4)

= GCD(4,0) = 4.



Discussion

No Comment Found

Related InterviewSolutions