User Defined Functions
Functions defined by us are known as User Defined Functions.
User Define Functions are created to perform some specific task by the programmer, for example if you want to find the sum of all array elements using your own function, then you will have to define a function which will take array elements as an argument(s) and returns the sum of all elements.
The logic/code will be written in the defined function and you have to just call this function within the program by passing actual arguments.
Definition
A function is a block of code that performs a specific task. C allows you to define functions according to your need. These functions are known as user-defined functions.
To Create A User Define Functions
You will have to keep following points in your mind :
- Declare the function with appropriate prototype before calling and defining the function.
- Function name should be meaningful and descriptive.
- Keep same argument data type and return data type in Declaration and Defining the function.
- Pass the same data type arguments which are provided in Declaration and Definition.
- The arguments/parameters which are used while calling the functions are known as Actual Arguments/Parameters and Arguments/Parameters which are used in the definition of the function are known as Local (Format) Arguments/Parameters.
main( ) function is also user defined function because the definition of main( ) is defined by us.
'); var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://ad.admitad.com/shuffle/289c251618/'+subid_block+'?inject_to='+injectTo; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })();