When you want to add a new function, you must add the function declaration above the main function
and implement it afterwards. (that is the style of your code - and it isnt the best way, but it works)
I think that you are missing basic programming knowledge and so should search for some
online tutorial or similar stuff. Maybe you watch some videos.