Created
July 27, 2021 22:22
-
-
Save luzperdomo92/694aac5b2f23aa590a00e518868d1a76 to your computer and use it in GitHub Desktop.
Solución números primos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function primos (n) { | |
for (let i = 2; i < n; i++){ | |
if( n % i === 0){ | |
console.log('No es primo'); | |
return; | |
} | |
} | |
console.log('es primo'); | |
} | |
primos(7); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment