ABSTRACT

This chapter introduces the concept of a function which is the most fundamental element of any programming language. A function is something that, when called, performs some tasks. We can think of a function as a small machine that takes some input and provides some output, depending on the input. Three essential concepts are discussed in this chapter: user-defined functions, recursive functions, and storage classes. Explanations of user-defined functions include its syntax and a detailed description of the function prototype. The chapter also explains terminologies like formal arguments, actual arguments, calling functions, and called functions. Recursion is another crucial concept in C, and this chapter describes how to solve problems using recursive functions. A storage class concept, which represents the scope, lifetime, and initial value of a variable, is also described. There are four kinds of storage classes present: auto, extern, register, and static.