Neither the first code nor the second code generates any output.:) So for your examples it is totally unimportant where the function is defined. It is not used.
@vald from moscow
I just do not provide the implmentation detail in main function I just want to know that when I provide function defnition before main then it works properly but when I provide function defnition after main then it did not give any output
do not goto the calling of add() function in main()