
Chapter 3
Modular Decomposition: Functions
3.1 Introduction
A function is the main decomposition unit in a C program and it carries out a
specific task in a program. When a function is called, it can receive input data from
another function; the input data passed from another function is called an argument.
The function can also return output data when it completes execution.
This chapter provides more details on function definitions, invocation, and de-
composition. It also discusses the basic mechanisms for data transfer between two
functions; several examples are included. Scientific and mathematical built-in func-
tions are used in case studies.
3.2