Last active
August 29, 2015 14:02
-
-
Save macikokoro/402403ea66427ae91707 to your computer and use it in GitHub Desktop.
For loop to print squares of odd numbers between 100 and 150 and ignore even numbers.
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
<script> | |
for (var i = 100; i <=150; i++) { | |
if (i % 2 == 1) { | |
console.log (i * i); | |
} | |
else { | |
console.log (i); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment