Skip to content

Instantly share code, notes, and snippets.

@ddailey
Created April 9, 2012 22:41
Show Gist options
  • Save ddailey/2347118 to your computer and use it in GitHub Desktop.
Save ddailey/2347118 to your computer and use it in GitHub Desktop.
FizzBuzz for Hacker School
<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