or invoked any number of times. Functions are used to encapsulate code that
performs a specific task. Sometimes functions are defined for commonly required
tasks to avoid the repetition entailed in typing the same statements over and
over. More generally, they are used to keep code that performs a particular job
in one place in order to enhance reusability and program clarity.
functions are parameterized or non-parameterized. A parameterized function
definition may include a list of identifiers, known as parameters that work as
local variables for the body of the function. Function invocations provide
values or arguments for the function’s parameters. Functions often use their
argument values to compute a return value that becomes the value of the
function invocation expression.
supports two types functions. They are
or Library Functions