Created
October 17, 2017 20:54
-
-
Save KimSarabia/6b529d5b8f64fd7357089f95f0a07b42 to your computer and use it in GitHub Desktop.
Prime Number For Loop
This file contains hidden or 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
for (var c = 2; c <= 100; c++) { | |
for (var i = c - 1; i >= 1; i--) { | |
if (i === 1) { | |
console.log(c); | |
} | |
if (c % i === 0) { | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment