[ create a new paste ] login | about

Link: http://codepad.org/5ZD3j0xb    [ raw code | output | fork | 1 comment ]

PHP, pasted on Sep 17:
1
2
3
4
5
6
7
    <?php
    $apples = 10;
    for ($i = 0; $i < 10; ++$i)
    {
        echo 'I have ' . $apples-- . " apples. I just ate one.\n";
    }
    ?>


Output:
1
2
3
4
5
6
7
8
9
10
    I have 10 apples. I just ate one.
I have 9 apples. I just ate one.
I have 8 apples. I just ate one.
I have 7 apples. I just ate one.
I have 6 apples. I just ate one.
I have 5 apples. I just ate one.
I have 4 apples. I just ate one.
I have 3 apples. I just ate one.
I have 2 apples. I just ate one.
I have 1 apples. I just ate one.


Create a new paste based on this one


Comments:
posted by madhu123 on Jun 28
reply