Advertisements
Advertisements
Question
What will be the output of the following PHP code?
<?php
for ($x = -1; $x < 10;--$x)
{
print $x;
}
?>Options
123456713910412
123456713910
1234567139104
Infinite loop
MCQ
Advertisements
Solution
Infinite loop
shaalaa.com
Looping Structure
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
for ($ x=0; $ x<5; x++)
echo “Hai”
The above loop executes how many no of times?
Consider the following code
<? php
$count=12;
do{
printf(“%d squared=%d<br/>”,
$count, pow($count,2));
} while($count<4);
?>
What will be the output of the code.
Define for loop in PHP.
What is For each loop in PHP?
Write the purpose of Looping Structure in PHP.
Differentiate For each and While loop.
Write short notes on Do while Loop.
Discuss in detail about Foreach loop.
Explain the process Do while loop.
Explain concepts of for loop with example.
