JavaScript program to find the factors of a number:
let number = parseInt(prompt("Enter a number:"));
console.log("The factors of " + number + " are:");
for (let i = 1; i <= number; i++) {
if (number % i === 0) {
console.log(i);
}
}
JavaScript program to find the factors of a number:
let number = parseInt(prompt("Enter a number:"));
console.log("The factors of " + number + " are:");
for (let i = 1; i <= number; i++) {
if (number % i === 0) {
console.log(i);
}
}