English

Explain concepts of for loop with example.

Advertisements

Question

Explain concepts of for loop with example.

Answer in Brief
Advertisements

Solution

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
  Is there an error in this question or solution?
Chapter 7: Looping Structure - Evaluation - PART – IV [Page 118]

APPEARS IN

Samacheer Kalvi Computer Applications [English] Class 12 TN Board
Chapter 7 Looping Structure
Evaluation - PART – IV | Q 4. | Page 118
Advertisements
Share
Notifications



      Forgot password?
Use app×