A C program is a collection of statements which are grouped into functions. Each function has a particular name, given by the programmer. The name reflects what the function does (e.g. set_bit). You get a function to do something for you by calling it. When you call a function the statements in it are obeyed in sequence.

Every C program must contain a function called main. This is the function which is called when the program starts. The main function can call other functions as it runs. When the main function finishes, the program ends.

The function main has a header which tells the compiler what the function is called, the value it returns (if any) and the data it works on (if any). The function main also has a body, which is the bit enclosed in curly brackets ({).

A number of statements enclosed in curly brackets is often called a block. In the case of our empty program the block is empty. For a working program the block can contain many hundreds, or even thousands, of statements.

The Virtual CPIC shows an empty C program which doesn't do anything. You can make the program run by pressing the GO button on the Virtual CPIC control panel You will see the cursor move over each line in turn. This is how the program actually executes. The computer obeys each line in sequence.