Computers were invented to solve problems which could not be solved manually with ease. In a computer, problems can be divided into small modules and then solved step-by-step.
the set of rules that define how a particular problem can be solved in a finite number of well defined steps is known as an algorithm. Each of the steps may require one or more operations.
The basic features of an algorithm are:
1. Each step of an algorithm is simple and definite.
2. Its logic is clear and unambiguous.
3. The logic of an algorithm is effective and has a unique solution for a problem.
4. It has a finite number of steps.
The success of a program depends largely upon the clarity and efficiency of the algorithm. If the algorithm is not properly designed, it makes the program prone to errors.
Characteristics of an algorithm:
1. Input: this part of an algorithm reads the data required for processing by accepting the input of a given problem.
2. Process: To perform the required computations in easy steps.
3. Finiteness: An algorithm should come to an end gracefully after a finite number of steps.
4. Effectiveness: Every step of an algorithm must be "simple"; their order should be unambiguous and the algorithm should execute within a definite period of time on a machine.
5. Output: It must give the desired output.
After analysing the problem correctly, the programmer has to understand the problem in order to develop a logic or method that can solve the problem. A computer program is a sequence of instructions outlining the steps to be performed by a computer. Translating an algorithm into a programming language is known as coding.