Functions
in c
Definition:
A function is a self contained program segment (or) A function is a sub program
(or) A function is a module that carries out some specific, well defined task.
A function is a
block of code that performs a particular task. Sometimes we need to write a
particular block of code for more than once in our program. This may lead to
bugs and irritation for the programmer. C language provides an approach in
which you need to declare and define a group of statements once and that can be
called and used whenever required. This saves both time and space.
Benefits of Using User
Defined Functions
1. It
provides modularity to the program.
2. Easy
code Reusability. You just have to call the function by its name to use it.
3. In
case of large programs with thousands of code lines, debugging and editing
becomes easier if you use functions.
In C - language functions can be classified into two categories,
No comments:
Post a Comment