Find smallest values of x and y such that ax | To find GCD using Eculcid 's algorithm ; Prints smallest values of x and y that satisfy " ax ▁ - ▁ by ▁ = ▁ 0" ; Find LCM ; Driver code
function gcd ( a , b ) { if ( b == 0 ) return a ; return ( gcd ( b , a % b ) ) ; } function findSmallest ( a , b ) { let lcm = parseInt ( ( a * b ) / gcd ( a , b ) , 10 ) ; document . write ( " " + parseInt ( lcm / a , 10 ) + " " + parseInt ( lcm / b , 10 ) ) ; } let a = 25 , b = 35 ; findSmallest ( a , b ) ;