1.

What is the lcm (a, b)?(a) a + b(b) gcd (a-b, b) if a>b(c) lcm (b, a)(d) a – bThe question was asked during an internship interview.This intriguing question comes from GCD LCM recursion topic in section Recursion of Data Structures & Algorithms II

Answer»

Correct ANSWER is (C) lcm (B, a)

Easy EXPLANATION - Since the LCM function is commutative, so lcm (a, b) = lcm (b, a).



Discussion

No Comment Found

Related InterviewSolutions