Algorithm is the step by step procedure to carry out any particular task, such as a mathematical or a logical problem.