You are viewing a single comment's thread. Return to all comments →
u have posed the doubt bit a time ago.
hope my clarification might help u
f is lcm of a, l is gcd of b.i is initialised to f and j is initialised to 2,
the termination condition is that i must not exceed l .inside the loop,we need to check if either i or its multiples divide l and their count.to get the next multiple of i,we use j.after the 1st iteration ,i is assigned the value of its next multiple by multiplying its current value with j and j is incremented and the loop goes on