Advertisements
Advertisements
Question
Define for loop in PHP.
Definition
Advertisements
Solution
For loop is an important functional looping system which is used for iteration logics when the programmer know in advance how many times the loop should run.
Syntax:
for (init counter; test counter; increment counter)
{
code to be executed;
}shaalaa.com
Looping Structure
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
Loops that iterate for fixed number of times is called ______.
for ($ x=0; $ x<5; x++)
echo “Hai”
The above loop executes how many no of times?
PHP supports which types of looping techniques ______.
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.
Write Syntax of For loop in PHP.
Write the features Looping Structure.
Write the purpose of Looping Structure in PHP.
Write short notes on Do while Loop.
Differentiate While and Do while loops.
Explain concepts of for loop with example.
