C++ program can contain any number of functions. But, it must always have only one main() function to begin the program execution. We can write the definitions of functions in any order as we wish. We can define the main() function first and all other functions after that or we can define all the needed functions prior to main(). Like a variable declaration, a function must be declared before it is used in the program. The declaration statement may be given outside the main() function
The prototype above provides the following information to the compiler:
1. The return value of the function is of type long.
2. Fact is the name of the function.
3. The function is called with two arguments:
- The first argument is of int data type.
- The second argument is of double data type, int display(int, int)//function prototype//
The above function prototype provides details about the return data type, name of the function and a list of formal parameters or arguments.