Skip to content

Instantly share code, notes, and snippets.

@KimSarabia
Created October 17, 2017 20:54
Show Gist options
  • Save KimSarabia/6b529d5b8f64fd7357089f95f0a07b42 to your computer and use it in GitHub Desktop.
Save KimSarabia/6b529d5b8f64fd7357089f95f0a07b42 to your computer and use it in GitHub Desktop.
Prime Number For Loop
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