English

Explain with a flowchart the following control structure: Iteration Logic

Advertisements
Advertisements

Question

Explain with a flowchart the following control structure:

Iteration Logic

Explain
Advertisements

Solution

The repeat for loop has the following form,

Form:

Repeat for K = R to S by T
[Module]
[End of loop]

where K = Index variable

R = Initial value of K

S = Final value of K

T = Step (increment/decrement)

The loop is executed for all values of K starting from R to S with a step of T.
It uses a condition to control the loop.

Form:

Repeat while condition:
[Module]
[End of loop]

The loop continues till a condition is true. There must be an initialisation statement, and there must be a statement that will change the index variable in the loop.

shaalaa.com
Basic Data Structures (Stack, Queue, Dequeue)
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×