nerdexam
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

200-530 question #21 exhibit

Options

  • A10
  • B9
  • C7
  • D8

How the community answered

(49 responses)
  • A
    76% (37)
  • B
    4% (2)
  • C
    12% (6)
  • D
    8% (4)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice