Skip to content

Instantly share code, notes, and snippets.

@whimsyniche
Created June 20, 2021 18:43
Show Gist options
  • Save whimsyniche/dbfd2e4a4c8f0d3ddbec324a9b37460f to your computer and use it in GitHub Desktop.
Save whimsyniche/dbfd2e4a4c8f0d3ddbec324a9b37460f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<h2>Code CracklePop</h2>
<p id="print"></p>
<script>
let text = "";
for (let i = 0; i < 101; i++) {
if (i%3 == 0 && i%5 == 0) {
text += i + "CracklePop" + "<br>";
}
else if (i%3 == 0) {
text += i + "Crackle" + "<br>";
}
else if (i%5 == 0) {
text += i + "Pop" + "<br>";
}
else {
text += i + "" + "<br>";
}
}
document.getElementById("print").innerHTML = text;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment