Created
April 9, 2012 22:41
-
-
Save ddailey/2347118 to your computer and use it in GitHub Desktop.
FizzBuzz for Hacker School
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 type="text/javascript"> | |
n = 1; | |
do | |
{ | |
if (n%3===0 && n%5===0) | |
{ | |
document.write("FizzBuzz"); | |
} | |
else if (n%5===0) | |
{ | |
document.write("Buzz"); | |
} | |
else if (n%3===0) | |
{ | |
document.write("Fizz"); | |
} | |
else | |
{ | |
document.write(n); | |
} | |
document.write("<br />"); | |
n++; | |
} | |
while (n <= 100); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment