Any program is a set of functions that the processor has to execute to give the user the required output.
A function is a set of instructions that the program executes when the function is called by the program at a certain time.
The main function is what the processor search for to start executing the program, in other words, the main function is the first function being executed by the processor. The main function can call then other functions within the program to execute certain action.
To write the program code, you most of the time will execute some predefined functions, like for example the writing and reading function which in C++, we call them cout and cin. These 2 functions were already defined in a library that allows your program to understand the functionalities iostream. I made a very small application, in the following part to help you better understanding how to start writing code. The namespace std is what allows your application to consume the standard functionalities.
using namespace std;
int add(int x, int y)
cout << add(4,4);