What will be the output of the following PHP code ?
<?php
$x;
for ($x = -3; $x < -5; ++$x)
{
print ++$x;
}
?>
<?php
$x;
for ($x = -3; $x < -5; ++$x)
{
print ++$x;
}
?>
A. -3-4-5
B. -3-4
C. infinite loop
D. no output
Answer: Option D
Solution(By Examveda Team)
The loop is not even entered as x is initially 0.Related Questions on Control Structures(Loop in PHP)
A. how are u
B. hi
C. error
D. no output
A. hi
B. no output
C. error
D. how are u
A. how are uhello
B. hihello
C. hi
D. no output
A. true
B. false
C. error
D. no output
Join The Discussion