O'Reilly logo

C Programming for Scientists and Engineers with Applications by Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER

5

Modular Design and Functions

5.1 Introduction to Modular Programming

5.2 Functions

5.3 Computation Functions

5.4 Input and Output Functions

5.5 Recursive Functions

5.6 Sample Programs

Chapter Summary

Exercises

Objective

To divide and subdivide the problem into logical modules. The modules are written in C as manageable and meaningful units called functions.

The concept of modular programming was introduced in Chapters 1 and 2. Large and complex engineering and scientific problems require many lines of code to solve them. It is difficult for a programmer to write the code of a long program as a single unit or to debug and maintain a long program as a single unit. It is easier to find logic and execution errors in short modules. When ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required