0
//Why is code doesn't works?//
function perfect(number) { for (let i = 1; i < number; i++) { if (number % i == 0) { var n = 0; console.log (n += i); } } if (n == number) { console.log ('Your number is perfect'); } else { console.log ('Your number is unperfect'); } } perfect(num = +prompt('Enter the number, and the computer will check if it is perfect'))
2 Respostas
0
Nikhil, thank you :)