Algorithmic constructions
Do you want to learn how to create powerful, intelligent, versatile, and useful programs?
Then you need to learn the three forms of flow control. According to computer systems theory, a good programming language should provide three forms of flow control.
1. Sequencing.
A sequence is a step-by-step algorithm in which operators are executed in a strict order. All our previous programs represented some sequence of operators.
2. Selection. The algorithm can change the sequence of steps depending on the logical condition.
If a condition is satisfied,
then do an action,
otherwise do another action.
3. Iteration. The algorithm repeats some sequence of steps a given number of times, or as long as a logical condition is met.
As long as the condition is met
do action.
The use of various forms of flow control allows programs to make decisions based on external factors, such as user input or data received from another part of the program.