June 2005
Beginner
480 pages
10h 31m
English
| 1: | The while statement loops as long as a condition is true. What statement loops as long as a condition is false?
|
| 2: | Is the following expression true or false?
(0 and 5) || ( ("0" or 0 or "") and (6 and "Hello")) or 1
|
| 3: | What is the value of $i after this loop is run?
for($i=0; $i<=10; $i++) { }
|
| A1: | b. The while (! condition ) {} syntax loops until the condition is false. |
| A2: | a. The expression can be reduced in these steps:
(false) || ( ( false ) and ( true ) ) or true false || false or true true |
| A3: | c. The test is $i<=10, so when the test is finally false, $i must be 11. If you got this one wrong, don't worry. It's such a common mistake that it even has a special name among ... |
Read now
Unlock full access