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.