Program to find LCM of 2 numbers without using GCD | Function to return LCM of two numbers ; Driver Code
< ? php function findLCM ( $ a , $ b ) { $ lar = max ( $ a , $ b ) ; $ small = min ( $ a , $ b ) ; for ( $ i = $ lar ; ; $ i += $ lar ) { if ( $ i % $ small == 0 ) return $ i ; } } $ a = 5 ; $ b = 7 ; echo " LCM ▁ of ▁ " , $ a , " ▁ and ▁ " , $ b , " ▁ is ▁ " , findLCM ( $ a , $ b ) ; ? >