Level 1

Function

views

4:04
A function is a set of commands written in one place to perform a certain task. Every C++ program has at least one function. You have seen void main() previously. It is also a function. As programs grow longer; the number of commands in the program increases. If all these commands are written one below the other, then it is difficult to understand the program. At such times functions are used to make the program structured which makes it easy to read and understand