You are on page 1of 4

Algorithms

Definition, Characteristics, Examples


Definition

• An algorithm is a finite step-by-step procedure


for solving a particular problem

• It is a finite sequence of steps which when


followed will give desired result
Characteristics
The following are the features or characteristics of an algorithm

• Finiteness : An algorithm terminates after a fixed number of


steps

• Definiteness : Each step of the algorithm is precisely defined.


It should be clear and unambiguous

• Effectiveness : All the operations used in the algorithm can be


performed exactly in a fixed duration of time.
Every step should be basic and essential

• Input : An algorithm may have 0 or more inputs

• Output : An algorithm must have one or more outputs


Write an algorithm to find the sum of two numbers

Step 1: Read two numbers n1 and n2


Step 2: Add n1 and n2 and store the result in
sum
Step 3: write sum
Step 4: Stop

You might also like