7
Contributors
6
Replies
8
Views
4 Years
Discussion Span
Last Post by diafol
0

Printing odd numbers? Shouldn't really be that hard.

$num = 1;
do {
    echo $num.'<br />';
    $num = $num+2;
} while ($num < 100);

Quite easy, just change the 100 to how far you want it to go.

0

Without putting some self effort we can't help you, and from this question, it looks like you are not serious in learning how to code.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.