Update sive.js
This commit is contained in:
parent
faf3952738
commit
996c3f9051
1 changed files with 0 additions and 2 deletions
2
sive.js
2
sive.js
|
@ -1,7 +1,6 @@
|
||||||
const readline = require("readline");
|
const readline = require("readline");
|
||||||
const { stdin: input, stdout: output } = require('node:process');
|
const { stdin: input, stdout: output } = require('node:process');
|
||||||
|
|
||||||
|
|
||||||
let primes = []
|
let primes = []
|
||||||
|
|
||||||
const isPrime = num => {
|
const isPrime = num => {
|
||||||
|
@ -16,7 +15,6 @@ const rl = readline.createInterface({ input, output });
|
||||||
rl.question('Sive to: ', (siveTo) => {
|
rl.question('Sive to: ', (siveTo) => {
|
||||||
siveTo = Number(siveTo)
|
siveTo = Number(siveTo)
|
||||||
|
|
||||||
|
|
||||||
for (var i = 1; i < siveTo; i++) {
|
for (var i = 1; i < siveTo; i++) {
|
||||||
if (isPrime(i)) {
|
if (isPrime(i)) {
|
||||||
primes.push(i)
|
primes.push(i)
|
||||||
|
|
Loading…
Reference in a new issue