[ create a new paste ] login | about

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

PHP, pasted on Mar 28:
1
2
3
4
5
6
7
8
9
10
11
<?php
$allowed = array (15, 28); // List here all the non % 10 value you want to print
for($i=10; $i<=50; $i++) {
    if ($i % 10 === 0) {
        echo $i."\n";
    }
    else if (in_array($i, $allowed)) {
        echo $i."\n";
    }
}
?>


Output:
1
2
3
4
5
6
7
10
15
20
28
30
40
50


Create a new paste based on this one


Comments: