why are functions neededlet us analyse the reasons why segmenting program into manageable chunks is an important aspect of programming dividing the program into separate well-defined functions facilitates each function to be written and tested separately this simplifies the process of getting the total program to work understandingcodingand testing multiple separate functions is easier than doing the same for one big function if big program has to be developed without using any function other than main()then there will be countless lines in the main(function and maintaining that program will be difficult task all the libraries in contain set of functions that the programmers are free to use in their programs these functions have been pre-written and pre-testedso the programmers can use them without worrying about their code details this speeds up program developmentby allowing the programmer to concentrate only on the code that he has to write like librariesprogrammers can also write their own functions and use them from different points in the main program or any other program that needs its functionalities when big program is broken into comparatively smaller functionsthen different programmers working on that project can divide the workload by writing different functions using functions function can be compared to black box that takes in inputsprocesses itand then outputs the result howeverwe may also have function that does not take any inputs at allor function that does not return any value at all while using functionswe will be using the following terminologiesa function that uses another function is known as the calling functionand is known as the called function the inputs that function takes are known as arguments when called function returns some result back to the calling functionit is said to return that result the calling function may or may not pass parameters to the called function if the called function accepts argumentsthe calling function will pass parameterselse not function declaration is declaration statement that identifies function' namea list of arguments that it acceptsand the type of data it returns function definition consists of function header that identifies the functionfollowed by the body of the function containing the executable code for that function function declaration before using functionthe compiler must know the number of parameters and the type of parameters that the function expects to receive and the data type of value that it will return to the calling program placing the function declaration statement prior to its use enables the compiler to make check on the arguments used while calling that function the general format for declaring function that accepts arguments and returns value as result can be given asreturn_data_type function_name(data_type variable data_type variable )herefunction_name is valid name for the function naming function follows the same rules that are followed while naming variables function should have meaningful name that must specify the task that the function will perform