how to find hcf of 2 numbers in javascript code example
Example: how to find hcf of 2 numbers in javascript
var a = userInput[0].split(" ").map(Number)
while(a[0] != a[1])
{
if(a[0] > a[1]) {
a[0] = a[0] - a[1];
}
else {
a[1] =a[1] - a[0];
}
}
console.log(a[0])