Program to find LCM of 2 numbers without using GCD | Function to return LCM of two numbers ; Driver program to test above function
function findLCM ( a , b ) { var lar = Math . max ( a , b ) ; var small = Math . min ( a , b ) ; for ( i = lar ; ; i += lar ) { if ( i % small == 0 ) return i ; } } var a = 5 , b = 7 ; document . write ( " " + a + " " + b + " " + findLCM ( a , b ) ) ;