Placement of these functions is dependent on the specific job that it is intended to do. Typically you declare it before INT MAIN, they after INT MAIN is written you can write the work part of the function a good example of that is here at this link. http://www.tutorialspoint.com/cplusplus/cpp_functions.htm