Loading Posts...

What is a Function ?

 

Function :

A function is a set of executable statements to carry out some specific task. The name of the function is given by the user. The function is also known as sub-program/method/sub-routine/procedure.

Those functions which are available with the programming language being used and transferred into the memory as soon as the software is loaded are known as pre-defined functions or in-built functions. The advantage of these functions is that as soon as, a particular function is used with suitable parameters, it gets executed and returns the result.

A function can be divided into following categories:

  1.  Pre-defined/Compiler defined/In-built functions
  2.  User defined functions

1.  Pre-defined/Compiler defined/In-built functions:

Those functions which are available with the programming language being used and transferred into the memory as soon as the software is loaded are known as pre-defined functions or in-built functions. The advantage of these functions is that as soon as, a particular function is used with suitable parameters, it gets executed and returns the result.

 

2.  User defined functions

The function which is created by the user to carry out some specific task is known as User-defined function. As the name of function is given by the user other than a keyboard or pre-defined function so it is known as User defined function.

To Write a program using functions/methods the following steps are needed :

(a) Function prototype or function declaration

(b) Function definition

(i) Non-return type function definition

(ii)  Return type function definition

(c) Function Invoking/Calling/executing function

 

 

Arun Kumar Murmu

We are working as Computer Faculty. We are an Website Developer, Designer, App Developer, Freelancer etc.

Leave a Comment

Loading Posts...
Inline
Inline