Algorithm
An algorithm is the first step in problem solving. A logical and concise list of steps required to solve a problem is called an algorithm.
A sequence of instructions must possess the following characteristics:
- Each and every instruction should be precise and unambiguous.
- Each instruction should be such that it can be performed in a finite time.
- One or more instructions should not be repeated infinitely. This ensures that the algorithm will ultimately terminate.
- After performing the instructions, that is after the algorithm terminates, the desired results must be obtained.
Example: There are 50 students in a class who appeared in their final examination. Their mark sheets have been given to you. Write an algorithm to calculate and print the total number of students who passed in first division.
Algorithm:
Step 1: Initialize TOTAL FIRST DIVISION and TOTAL MARKSHEETS CHECKED to zero.
Step 2: Take the marksheet of the next student.
Step 3: Check the division column of the marksheet to see if it is I: if no, go to Step 5.
Step 4: Add 1 to TOTAL FIRST DIVISION.
Step 5: Add 1 to TOTAL MARKSHEETS CHECKED.
Step 6: Is TOTAL MARKSHEETS CHECKED=50; if no, go to step 2.
Step 7: Print TOTAL FIRST DIVISION.
Step 8. Stop.
Characteristics of Algorithmic language
Some characteristics of algorithm language is mentioned below:
- An algorithmic language should be viewed as a set of guidelines for building algorithm, not as a rigid set of rules. There will not be any rules for punctuation, spelling, vocabulary, or use of synonyms.
- The representation of algorithms in our algorithmic language will clearly indicate the relationships among various statements and thus allow us to gain a better picture of the overall organization and structure of the solution of the problem.
- An algorithmic language is step-by-step process for solving the problem.