Functions:


A function is a self contained block of statements enclosed between braces that perform a specific task. A function groups a number of repeated statements in a program into a single unit and is identified by a name known as a function name. A program can contain one or more functions, but the main ( ) function must be part of every program. It is the main ( ) function form which the program’s execution begins. Other additional functions must be subordinate to it and to one another. A programmer can invoke a function at different places in a program whenever it is needed instead of writing the same set of instructions again and again in the program. After the function has performed the intended task, the control is returned back to the calling function and continues with the rest of the statements in its body.

Classifications of Functions:
Functions can be classified broadly in two categories :
i.                    Library functions.

ii.                  User-defined functions

Previous                                                                                    Next


Powered by Blogger.