Home Segments Index Top Previous Next

20: Mainline

The following program, which computes the average of three prices, consists of just one function, the main function:

main ( ) { 
  (10.2 + 12.0 + 13.2) / 3; 
} 

This main function consists of the function name, main, followed by matched parentheses—which you should ignore for now—followed by a single statement sandwiched between matched braces that delimit the function's body.

The one and only statement in the body of the main function contains two instances of the addition operator, +, and one instance of the division operator, /. Note that this statement, like most C statements, is terminated by a semicolon.

The semicolon, the parentheses, and the braces act as punctuation. Occasionally, such symbols, in such contexts, are called punctuators.

Note also that the sample program is quite catatonic: It accepts no input data and produces no output result.