book : problem solving and program design
CHAPTER 3
Library
Functions
·
Predefined Functions and Code Reuse
A primary goal
of software engineering is to write error-free code. Code reuse, reusing
program fragments that have already been written and tested whenever possible,
is one way to accomplish this goal. Stated more simply, “Why reinvent the
wheel?”
·
Top-Down Design with Functions
C promotes reuse
by providing many predefined functions that can be used to perform mathematical
computations. C’s standard math library defines a function named sqrt that
performs the square root computation. The function call in the assignment
statement