User defined Function
" Function is defined as a group of statements that together perform a specific task. "
- Main() is a function, therefore every C++ program should have at least one function.
- Function is divided into 3 part
1 - function declaration
2 - function definition
3 - function call
- A function definition means body of the function.
- A function call is a part of main programs and it specified which function should be called.
Example -
There are four possible style to write a function in your program -
1- void function with no argument
e.g-
2- void function with argument
e.g-
Note- Arguments in the function always assign from RIGHT to LEFT.
3- Non void function with no argument
eg-
4- Non void function with argument
eg-
Note- Arguments in the function always assign from RIGHT to LEFT.
Please read ... For better Understanding
Difference between a formal and an actual parameter And Call By Value & Call By Reference
Difference between a formal and an actual parameter And Call By Value & Call By Reference
Comments
Post a Comment