Professional Documents
Culture Documents
Chapter 5 Notes
Chapter 5 Notes
Take Do Retur n
Ar gu men Wo r k
t Re su l t
it can be us ed multiple
times increase code
reusability
Syntax 1
Function
Prototype
void printHello( );
void printHello() {
pr intf(" Hello");
}
> Do the
Syntax 3
Function Call
int main() {
pr intHello( )
; return 0 ;
}
> U s e the
Properties
Library U s er -
defined
fu nction
Special declar ed & defined
functions by programmer
inbuilt in C
s canf( ), pr intf(
)
Passing
Arguments
functions can take val ue & give some
v al ue
parameter r etur n
v alu e
Passing
Arguments
void printHello( );
void printTable(int
b);
Passing
Arguments
functions can take val ue & give some
v al ue
parameter r etur n
v alu e
Argument v/s
Parameter
v al u e s that v alu es in
are passed in fu nction
function call declaration &
definition
us ed to us ed to
send receive
v al u e v al u e
actual formal
par ameter par ameters
NOTE
in calling function.
Beca us e a copy of argument i s passed to the function
Recursion