PHP Compiler
<!DOCTYPE html> <html> <body> <?php $num1 = 45; $num2 = 90; $max = ($num1 > $num2) ? $num1: $num2; while(1) { if(($max % $num1 == 0) && ($max % $num2 == 0)) { echo "LCM of $num1 and $num2: $max <br>"; break; } ++$max; } ?> </body> </html>
OUTPUT
LCM of 45 and 90: 90
×

Save as Private