Skip to content

Instantly share code, notes, and snippets.

@hodbby
Created June 13, 2012 06:39

Revisions

  1. hodbby created this gist Jun 13, 2012.
    33 changes: 33 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    <html>
    <head><title>FizzBuzz</title></head>
    <body>
    <script type="text/javascript">

    document.write ("Counting 1 to 100, when ever number devide in 3 it is fuzz, when number devide in 5 it is buzz and both are fizzbuzz... ");
    document.write (" ");

    for (i=1; i<=100; i++) {

    if (i % 3 === 0 && i % 5 === 0) {
    document.write(" FizzBuzz ,");
    }

    else if ( i % 3 === 0 ) {
    document.write(" Fizz ,");
    }

    else if (i % 5 === 0 ) {
    document.write(" Buzz ,");
    }

    else {
    document.write(i);
    document.write (" ,");
    }
    }


    </script>

    </body>
    </html>