Program to find LCM of two numbers | Recursive function to return gcd of a and b ; Function to return LCM of two numbers ; Driver program to test above function
function gcd ( a , b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } function lcm ( a , b ) { return ( a / gcd ( a , b ) ) * b ; } let a = 15 , b = 20 ; document . write ( " " + a + " " + b + " " + lcm ( a , b ) ) ;