In this lesson, we will learn about functions in a program, with a focus on the following key points,
- What are functions, and why do we use them?
- Working with function parameters, return, and call statements.
For the Python version of this lesson, please click here.
In this lesson, we will learn about a fundamental concept in programming called functions
. Functions provide a modular structure to the code. They perform a single action and provide a method to reuse a code block in different parts of the program. Functions are known by various terminologies in computer science. Methods
, procedures
, and subroutines
are some of the common ones.