Skip to Main Content
Programming and Data Structures
book

Programming and Data Structures

by Ashok Kamthane
August 2009
Intermediate to advanced content levelIntermediate to advanced
604 pages
21h 39m
English
Pearson India
Content preview from Programming and Data Structures
Functions 317
10.2 DEFINITION OF A FUNCTION
A function is a self-contained block or a sub-program of one or more statements that perform a
special task when called.
Why use Functions
1) If we want to perform a task repeatedly then it is not necessary to rewrite the particular block of
a program again and again. Shift the particular block of statements in a user-defined function.
The function defined can be called any number of times to perform the task.
2) Using functions, large programs can be reduced to smaller ones. It is easy to debug and find out
the errors in it. It also increases readability.
How a Function Works
1) Once a functi ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Data Structures and Algorithms

Learning Data Structures and Algorithms

Rod Stephens
Data Structures and Algorithms in C++, Second Edition

Data Structures and Algorithms in C++, Second Edition

Michael T. Goodrich, Roberto Tamassia, David M. Mount

Publisher Resources

ISBN: 9789332506343