Skip to main content
Engineering LibreTexts

7: Conditional Loops

  • Page ID
    • 7.1: Do While Loop
      There are two commonly used test after loops in the iteration (or repetition) category of control structures. They are: do while and repeat until.
    • 7.2: Flag Concept
      For centuries flags have been used as a signal to let others know something about the group or individual that is displaying, flying or waving the flag. There are country flags and state flags. Ships at sea flew the flag of their country. Pirates flew the skull and cross bones.
    • 7.3: Assignment vs Equality within C++
      Most control structures use a test expression that executes either selection (as in the: if then else) or iteration (as in the while; do while; or for loops) based on the truthfulness or falseness of the expression. Thus, we often talk about the Boolean expression that is controlling the structure.
    • 7.4: Increment and Decrement Operators
      The idea of increment or decrement is to either add or subtract 1 from a variable that is usually acting as a flag.
    • 7.6: While Loop
      The concept of iteration is connected to possibly wanting to repeat an action. Like all control structures we ask a question to control the execution of the loop. The term loop comes from the circular looping motion that occurs when using flowcharting.