0% found this document useful (0 votes)
20 views1 page

Algorithm: An Algorithm Must Possess The Following Characteristics

The document discusses algorithms in computer programming. An algorithm is defined as a step-by-step procedure for writing programs to obtain a desired result. An algorithm must be precise, unambiguous, capable of being performed in a finite time, and terminate with the desired result. Examples are provided of algorithms to add two numbers and find the average of four numbers by outlining the step-by-step instructions.

Uploaded by

Yubraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Algorithm: An Algorithm Must Possess The Following Characteristics

The document discusses algorithms in computer programming. An algorithm is defined as a step-by-step procedure for writing programs to obtain a desired result. An algorithm must be precise, unambiguous, capable of being performed in a finite time, and terminate with the desired result. Examples are provided of algorithms to add two numbers and find the average of four numbers by outlining the step-by-step instructions.

Uploaded by

Yubraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Computer Programming

Compiled by : Er. Yubraj Chaudhary

Algorithm
In computer science, algorithm is a step by step procedure for
writing programs. It is defined as a sequence of instructions
designed in such a way that if the instructions are executed in
the specified sequence, the desired result will be obtained.

An algorithm must possess the following characteristics.


1. Each and every instruction should be precise (exact,
accurate) and unambiguous (single clearly defined meaning
- lljwfd'Q).
2. Each instruction should be such that it can be performed in
a finite time (lglZrt ;do).
3. One or more instructions should not be repeated infinitely.
This ensures that the algorithm will ultimately terminate.
4. After performing the instructions, that is after the algorithm
terminates, the desired result must be obtained.

Examples:
1) Write an algorithm to add two numbers
Algorithm
Step 1 : Read two numbers (a,b)
Step 2 : Add the two numbers (result = a+b)
Step 3 : Print the result
2) Write an algorithm to find the average of four numbers
Algorithm
Step 1 : Read four numbers (a,b,c,d)
Step 2 : Add the four numbers (sum = a+b+c+d)
Step 3 : Divide the result of addition by 4 (result = sum/4)
Step 4 : Print the result
Diploma in Electrical Engineering II/I
Manmohan Memorial Polytechnic

1 of 1

You might also like