Compare for loop and for each loop.
Advertisements
प्रश्न
Compare for loop and for each loop.
अंतर स्पष्ट करें
Advertisements
उत्तर
| for loop | for each loop |
| loops through a block of code until the counter reaches a specified number. | loops through a block of code for each element in an array. |
|
|
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?
What will be the output of the following PHP code?
<?php
for ($x = 1; $x < 10;++$x)
{
print “*\t”;
}
?>Define Looping Structure in PHP.
Define for loop in PHP.
Write Syntax of while loop in PHP.
Explain the use of for each loop in PHP.
Write short notes on Do while Loop.
Discuss in detail about Foreach loop.
Explain the process Do while loop.
Explain working of loops in array.
