हिंदी

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Looping Structure - Evaluation - PART – IV [पृष्ठ ११८]
Advertisements
Share
Notifications



      Forgot password?
Use app×