teach-ict.com logo

THE education site for computer science and ICT

2. Sequence

Sequence in a computer language means that programming statements are set out one after another. Unless the CPU is told otherwise, it will carry out each instruction in turn.

Therefore a 'sequential language' such as Python or 'C' sets out source code instructions one after another.

In pseudocode, each instruction is set out like this

                           Do this
                           Next do this
                           Then do this 
                           ....

More formally, it may look more like this:-

                         x  3
                         MyVariable  34
                         New_Variable  x + MyVariable

Usually the order of a sequence is important. For example the pseudocode below cannot work because New_Variable is trying to use MyVariable and x before they are given a value

         
                         New_Variable  x + MyVariable               
                         x  3
                         MyVariable  34
                         

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 sequencing?