Three Seperate Functions

Basically, I have this code that has three separate functions, but it's all under the int main(). What I want to know is how I can separate the three functions without receiving syntax errors and losing all my code?

theoretically, const ints can work as well, but from what I understand it wouldn't be compiler portable, as some compilers accept consts int array dimensions and some don't. so just use the #define to macro your dimensions.