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:

type function_name (parameters)

If the type definition is omitted C assumes that function returns an integer type (integers are treated like index numbers, means, they have no decimal point). NOTE: This can be a source of problems in a program.

So returning to our first C program:

/* Sample program */

main()

NOTE:

Let us look at another printing statement:

printf(".\n.1\n..2\n...3\n");

The output of this would be:

.

.1

..2

...3


drago@scri.fsu.edu
Jan. 1997