Vidyalelo
PHP · Q61

Control Structures(Loop In PHP)

Programming · PHP · question 61

Q61

What will be the output of the following PHP code ?

A.
123456789101112
Answer
B.
12345678910
C.
1234567891011
D.
infinite loop

Answer: Option A

Solution

Answer: Option A
Solution:
The value of x is incremented and printed twice before checking,thus last loop it prints 11 and 12.