Explain concepts of for loop with example.
Advertisements
प्रश्न
Explain concepts of for loop with example.
संक्षेप में उत्तर
Advertisements
उत्तर
For loop is an important functional looping system which is used for iteration logic when the programmer knows in advance how many times the loop should run.

Flowchart of For loop Structure and Flow chart
Syntax-
for (init counter; test counter; increment counter)
{
code to be executed;
>
Example:
<?php
for ($i = 0; $i<= 10; $i++)
{
echo “The number is: $i<br>”;
}
?>shaalaa.com
Looping Structure
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
APPEARS IN
संबंधित प्रश्न
Which loop evaluates condition expression as Boolean, if it is true, it executes statements and when it is false it will terminate?
for ($ x=0; $ x<5; x++)
echo “Hai”
The above loop executes how many no of times?
Define Looping Structure in PHP.
Define for loop in PHP.
What is For each loop in PHP?
Write Syntax of For each loop in PHP.
Write the purpose of Looping Structure in PHP.
Write short notes on Do while Loop.
Explain Looping Structure in PHP.
Discuss in detail about Foreach loop.
