A function is a block of code that performs a specific task, with the help of function we can divide complex or large program into small components makes program easy to understand and we can find error.
A large program can be divided into different parts called modules. Where each module does a specific task so each module is called a function.
Types of function:-
Library function/pre-defined function
User-defined function
Note:
Functions act like building blocks using which any desired activity can be performed by combining one or more functions.