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.

Sequence means to carry out a set of actions one after another in an ordered way. Computer languages that lay out their instruction in this way are said to be sequential languages

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

                           Input data
                           Do something with data
                           Output results
                           ....

More formally, it may look more like this:-

                         x = input("Pick a number")
                         y = input("Pick a second number")
                         x_and_y = x + y
                         print (x_and_y)

The order of a sequence is important. The above code will not run if you try to process information before it is input, and you cannot output the results before the data is processed.

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?