teach-ict.com logo

THE education site for computer science and ICT

3. Program structure and flow

It is possible to write a program as a single unbroken block of code. The program begins with the first instruction then the next instruction is run and so on until the program ends with the last instruction being carried out.

Start
Do this
Do this
Do this
Do this
End

But in reality any non-trivial program will be more complicated than this.

program flow

The diagram shows a program that has loops. It also makes calls to several subroutines or functions. It may be periodically interrupted by other programs and then continue where it left off.

This path that the program follows is called the 'program flow'. As you can see, program flow can be simple or very complicated, depending on what it is asked to do. You can map out the program flow using a flowchart.

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: What is program flow?