A key part of C programming, as in many other languages, is the ability to break up a program into smaller chunks that can be called, usually by name, from within other code blocks. In C, this is done using functions.
Functions are pieces of named code—code blocks that are self-contained, called by name, can take parameters, and provide return values. Recall the first-ever function declaration you saw:
<return type> main ( [argument list] )
This generic definition is incomplete because it does not contain any C code to be executed when the function is called. To expand upon this declaration, you can add a function body to it, which will actually do some work. The general form for declaring an entire function is as follows: ...