|
He practises with the Control structures |
|
|
|
We have two variables, $th and $b, give a value to each one, the smallest value to $th and the biggest to $b, for example 8 and 16, want that all the numbers appear from $th up to $b except the multiple numbers of 10. In case of 3 and 16 the result must be:
8
9
11
12
13
14
15
16
How would you do it in PHP?
To see Solution.
<? php
$th = 8;
$b = 16;
for ($i=$a; $i <=$b; $i ++) {
if ($i % 10! = 0) {
I begin $i." <br> ";
}
}
?>
|