Zend
200-530 · Question #21
Consider the following code: <?php $x=0; $i; for($i=0;$i<5;$i++) { $x+=$i; } print($x) ?> What will be the value of x?
The correct answer is A. 10. See the full explanation below for the reasoning.
Question
Consider the following code: <?php $x=0; $i; for($i=0;$i<5;$i++) { $x+=$i; } print($x) ?> What will be the value of x?
Exhibit
Options
- A10
- B9
- C7
- D8
How the community answered
(49 responses)- A76% (37)
- B4% (2)
- C12% (6)
- D8% (4)
Community Discussion
No community discussion yet for this question.
