The formal representation of the algorithm has following two parts:
1. The first part describes the input data, the purpose of algorithm and the variables that will be used in the algorithm and their purpose.
2. The second part contains sequence of instructions or steps which are to be used to get the required results.
Algorithm to add two numbers is given below: