Tub Ko‘paytuvchilar Virtual Laboratoriyasi

Berilgan sonni tub ko‘paytuvchilarga ajratish (masalan, 12 → 2 × 2 × 3)

let n = parseInt(document.getElementById("nInput").value);
let factors = [];
let i = 2;
while (n > 1) {
  if (____?____) {
    factors.push(i);
    ____?____;
  } else {
    i++;
  }
}
document.getElementById("result").textContent = "Tub ko‘paytuvchilar: " + factors.join(" * ");
  
n % i == 0
n = n / i
n % i != 0
n = i