Lec 08 Flowchart - Loop control structure
Lec 08 Flowchart - Loop control structure
6
Flowchart for a While Loop
• Explanation:Repeats steps while the condition
is true.
• Structure:
• Check condition.
• Execute block.
• Repeat or Exit.
• Example: Sum numbers until the total exceeds
50.
7
Example Flowchart: While Loop
8
Flowchart for a Do-While Loop
• Explanation:Executes steps at least once
before checking the condition.
• Structure:
• Execute block.
• Check condition.
• Repeat or Exit.
• Example: Display “Hello!” until a user enters
“Stop”.
9
Example Flowchart: Do-While
Loop
Common Mistakes in Loop
Flowcharts
• Forgetting termination or increment steps.
• Creating infinite loops with incorrect
condition checks.
• Missing loop-back arrows or unclear
conditions.
Practice Exercise