[ create a new paste ] login | about

Link: http://codepad.org/F81nfQIp    [ raw code | output | fork ]

PHP, pasted on Aug 29:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

for($i=1; $i<100; $i++)
{
    if($i % 3)
    {
        echo "[3] Fizz\n";
    }
    elseif($i % 5)
    {
        echo "[5] Buzz\n";
    }
    elseif(($i % 3) && ($i % 5))
    {
        echo "[*] Fizz Buzz\n";
    }
}


Output:
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz
[3] Fizz
[3] Fizz
[5] Buzz


Create a new paste based on this one


Comments: