CCP Lab Manual, 10CPL16/26
Dept of CSE, CMRIT, B’
37 Page 1
The Meaning of an Algorithm
An algorithm is a basic tool which is used to express the solution for a given problemsystematically in the form of instructions. This solution is called logic. It takes a set of inputvalues and produces the desired output.
An algorithm is defined as unambiguous, step by step procedure (instructions) to solve agiven problem in finite number of steps by accepting a set of inputs and producing the desiredoutput. After producing the result, the algorithm should terminate. Usually, Algorithm arewritten in simple English like statements along with simple mathematical expressions.
Characteristics of an Algorithm:
It may accept a zero or more inputs.
It should produce at least one output(result).
Each instruction must be clear , well-defined and precise. There should not beany ambiguity.
It shoild be a sequence of finite instructions. That is, it should end after a fixedtime. It should not enter into an infinite loop.
This means that operations must be simple and are carried out in a finite timeat one or more levels of complexity. It should be effective whenever traced manually for theresults.
Name of the Algorithm
Algorithm to find Area of Rectangle:
Step 1: [Read the values of length and breadth]Read length, breadth.Step 2: [Find the area of rectangle]Area=length*breadth.Step 3: [Output the result]Print area.Step 4: [End of Algorithm]Stop