Advertisements
Advertisements
प्रश्न
Define for loop in PHP.
परिभाषा
Advertisements
उत्तर
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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
APPEARS IN
संबंधित प्रश्न
What will be displayed in a browser when the following PHP code is executed:
<?php
for (Scounter = 20; $counter< 10;
$counter++)
{
echo “Welcome to Tamilnadu “;
}
echo “Counter is: Scounter”;
?>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.
What will be the output of the following PHP code?
<?php
for ($x = 1; $x < 10;++$x)
{
print “*\t”;
}
?>What will be the output of the following PHP code?
<?php
for ($x = -1; $x < 10;--$x)
{
print $x;
}
?>What is For each loop in PHP?
List out Looping Structure in PHP.
Write Syntax of For loop in PHP.
Write Syntax of For each loop in PHP.
Differentiate While and Do while loops.
Explain Looping Structure in PHP.
