First C Program


You are looking at the simplest possible C program. There is no way to simplify this program,
or to leave anything out. Unfortunately, the program doesn’t do anything.
main()
{}
The word "main" is very important, and must appear once, and only once, in every C program.
This is the point where execution is begun when the program is run. We will see later that this
does not have to be the first statement in the program, but it must exist as the entry point.
Following the "main" program name is a pair of parentheses, which are an indication to the
compiler that this is a function. We will cover exactly what a function is in due time. For now,
I suggest that you simply include the pair of parentheses.
The two curly brackets { }, properly called braces, are used to define the limits of the program
itself. The actual program statements go between the two braces and in this case, there are no
statements because the program does absolutely nothing. Youcan compile and run this program,
but since it has no executable statements, it does nothing. Keep in mind however, that it is a
valid C program.