JavaScript Lab 3
// Print prime Numbers...
let range = 1; while (range < 10) { let count = 0; for (let i = 1; i <= range ; i++) { if (range % i == 0) { count++; } } if (count == 2) { console.log(range); } range++; } // Printing Star patten for (let i = 1; i <= 5; i++) { console.log(new Array(i + 1).join("*")); }
Comments
Post a Comment