functions in c++

Functions :-
A program may be broken up into manageable functions.
Ecplainaton:-
A function is a collection of statements that performs a specific task. So far you have experienced functions in two ways: (1) you have created a function named main in every program you’ve written, and (2) you have used library functions such as pow and strcmp .
Functions are commonly used to break a problem down into small manageable pieces.Instead of writing one long function that contains all of the statements necessary to solve a problem, several small functions that each solve a specific part of the problem can be
written. These small functions can then be executed in the desired order to solve the problem.
This approach is sometimes called divide and conquer because a large problem is divided into several smaller problems that are easily solved.  one that uses a long complex function containing all of the statements necessary to solve a problem, and another that divides a problem into smaller problems, each of which are handled by a separate function
When creating a function, you must write its definition. All function definitions have the
following parts:
Return type: A function can send a value to the part of the program that executed it. The return type is the data type of the value that is sent from the
function.
Name: You should give each function a descriptive name. In general, the same
rules that apply to variable names also apply to function names.
Parameter list: The program can send data into a function. The parameter list is a list of
variables that hold the values being passed to the function.
Body: The body of a function is the set of statements that perform the function’s
operation. They are enclosed in a set of braces.