1.

What is the following expression, lcm (a, lcm (b, c) equal to?(a) lcm (a, b, c)(b) a*b*c(c) a + b + c(d) lcm (lcm (a, b), c)I have been asked this question during an interview for a job.My query is from GCD LCM recursion in section Recursion of Data Structures & Algorithms II

Answer»

The correct answer is (d) lcm (lcm (a, b), c)

For EXPLANATION: SINCE LCM function follows ASSOCIATIVITY, HENCE lcm (a, lcm (b, c) is equal to lcm (lcm (a, b), c).



Discussion

No Comment Found

Related InterviewSolutions