Download presentation
Presentation is loading. Please wait.
Published byἈριδαίος Μαυρίδης Modified over 6 years ago
2
A function is a group of statements that exist within a program for the purpose of performing a specific task. We can use functions to divide and conquer a task
4
Benefits Simpler Code: Code is easier to read and understand.
Code Reuse: Functions reduce duplication of code, if a specific operation is performed multiple times, it can be written once and used over and over again. Better Testing: With each task in its own block, its easier to test and develop. Faster Development: If a programmer has to develop multiple programs, and he discovers that certain tasks are common to them, he can write a function or functions to perform those tasks and reuse them. Easier Facilitation of Teamwork: Functions make it easier to do collaboration.
7
What mistake can we find in the following code?
8
Scope and Local Variables
9
Passing Arguments to Functions
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.