हिंदी

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.
for (init counter; test count­er; increment counter)
{
code to be executed;
}
for each ($array as $value)
{
code to be executed;
}
shaalaa.com
Looping Structure
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Looping Structure - Evaluation - PART – II [पृष्ठ ११८]
Advertisements
Share
Notifications



      Forgot password?
Use app×