Next: Variables Up: Basic C Programming Previous: Basic C Programming

C Program Structure

A C program basically has the following form:

We must have a main() function.

A function has the form:

If the type definition is omitted C assumes that function returns an integer type. NOTE: This can be a source of problems in a program.

So returning to our first C program:

NOTE:

Let us look at another printing statement:

printf(``.n.1n..2n...3n'');

The output of this would be:


Dave.Marshall@cm.cf.ac.uk
Wed Sep 14 10:06:31 BST 1994