TYPES OF FUNCTIONS
1.With No arguments and no return type:
⦁(i) In this type of function ,the function is called without passing any arguments.so the control moves fromcalling function to called function.
⦁(ii) the variables are declared in th function,data is processed in the function and the result is also displayed in the function.Now the control returns from called to calling function.
2.with Arguments and no return type:
In this type of function the function is invoked by passing some arguement
⦁(i) now the control moves from calling function t the called function with these arguements
⦁(ii) if any variables required,declared in the function
⦁(iii) process the data
⦁(iv) display the result in the function
⦁(v) the control returns back to its calling function
⦁(vi) Actual parameters:the parameters present in the function call are call actual parameters.
⦁(vii) Formal parameters:The parameters present in the function definition are called Formal parameters
⦁(viii) The actual and formal parameters should be in:
a. in number and data types
3.With Arguments and return type:
⦁(i) The result is not displayed in the function ,it will send back to the program
⦁(ii) RETURN : By using return statement ,the result is sent back to its calling function
4.Call by reference.
|