PHP Control Structures (Loop)
What will be the output of the following PHP code ?
for ($count = 1; $count != 20;$count++) {
print $count;
$count++;
}

13579…21
123…….20
1357…19
Infinite

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$i = "";
while ($i) {
print "hi";
}
while($i < 8)
$i++;print "hello";

Hi is printed 8 times, hello 7 times and then hi 2 times
Hi is printed once, hello 7 times and then hi 2 times
Hi is printed 10 times, hello 7 times
Hi is printed once, hello 7 times

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$a = array("hi", "hello", "bye");
for (;count($a) < 5;) {
if (count($a) == 3)
print $a;
}

hihellobyehihellobyehihellobyehihellobyehihellobyehihellobye…..infinitely
no output
ArrayArrayArrayArrayArrayArray….infinitely
(“hi”,”hello”,”bye”)(“hi”,”hello”,”bye”)(“hi”,”hello”,”bye”)(“hi”,”hello”,”bye”)…infinitely

ANSWER DOWNLOAD EXAMIANS APP