Computer Languages
Elements - Statements and Keywords


A Statement is a description of an action or condition.

For example, the 'do/while' statement directs program flow to repeat a particular line or block of code while a given condition does not apply.

A keyword, such as do, while, for, next etc, is a word the compiler understands. Depending on the keyword the compiler will look for certain structures in the code.

The following example shows how a do/while statement could be used in a computer program:

Program Description
counter := 0; sets a counter to 0 to start with
while (counter < 3)do loops the code below until the counter is greater than or equal to 3

counter := counter + 1;

Adds 1 to the value of the counter, making it 1, then 2, then 3

print("Hello");

Prints 'Hello' to the screen while the counter is less than 3