-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathif_and_or.php
39 lines (37 loc) · 1 KB
/
if_and_or.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
$x = 0;
$y = 5;
$z = 10;
// TODO:
// If $x < $y < $z then echo "{$x} < {$y} < {$z}\n";
if ($x < $y && $y < $z){
echo "{$x} < {$y} < {$z}\n";
}
// TODO:
// If 0 is less than $x OR $x is less than 10
// then echo the result as a sentence "0 is less than {$x} OR {$x} is less than 10".
if(0 < $x || $x < 10){
echo "0 is less than {$x} OR {$x} is less than 10\n";
}
// TODO:
// repeat the if statement for $y and $z.
if(0 < $y || $y < 10){
echo "0 is less than {$y} OR {$y} is less than 10\n";
}
if(0 < $z || $z < 10){
echo "0 is less than {$z} OR {$z} is less than 10\n";
}
// TODO:
// If 0 is less than $x AND $x is less than 10
// then echo the result as a sentence "0 is less than {$x} AND {$x} is less than 10".
if (0 < $x && $x < 10) {
echo "0 is less than {$x} AND {$x} is less than 10\n";
}
// TODO:
// repeat the if statement for $y and $z.
if (0 < $y && $y < 10) {
echo "0 is less than {$y} AND {$y} is less than 10\n";
}
if (0 < $z && $z < 10) {
echo "0 is less than {$z} AND {$z} is less than 10\n";
}