Skip to main content Accessibility help
Internet Explorer 11 is being discontinued by Microsoft in August 2021. If you have difficulties viewing the site on Internet Explorer 11 we recommend using a different browser such as Microsoft Edge, Google Chrome, Apple Safari or Mozilla Firefox.

Chapter 13: Function

Chapter 13: Function

pp. 320-366

Authors

, Techno India Hooghly, West Bengal, , Techno India College of Technology, West Bengal
  • Add bookmark
  • Cite
  • Share

Extract

The basic principle to define a function is to divide a large program into some smaller modules so that a complicated task can be broken into simpler and more manageable form that can be handled easily. These smaller modules are used to accomplish a definite task.

Function is a self-contained block of statements that perform some specific job. In C language, we achieve the modular programming using function. Functions in C are categorized into two groups. They are Library function and User defined function. Library functions are defined within several header files as per individual category of the functions. We already discussed some library functions and some other will be discussed later. Though C supports a large number of library functions, but this is not sufficient. According to our requirement we need to define our own functions. These are called user defined function. In this chapter we will discuss how a user defined function can be defined and how it can be accessed, etc.

Basically, any C program is a collection of one or more functions. If it contains only one function, then it is the main function. In C program main function is a special function. Every C program starts its execution from main function and other functions are called from this function as well. Every C program must have a main function and more than one main function is not possible in a single program. However, a C program may contain more than one user defined function and there is no restriction on this.m

About the book

Access options

Review the options below to login to check your access.

Purchase options

Paperback
US$105.00

Have an access code?

To redeem an access code, please log in with your personal login.

If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.

Also available to purchase from these educational ebook suppliers