lcm calculate in javascript

technical talkiess
0

 <script>

var n1 = prompt("Enter the number");

var n2 = prompt("Enter the number");

let vishal = (n1 > n2) ? n1 :n2;


while(true){

if(vishal % n1 == 0 && vishal % n2 == 0){

alert(vishal);

break;

}

vishal++;

}

</script>

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)