Algorithm- Class 12 Unit 1

An algorithm is a sequence of instructions or step by step instruction to find the solution of a problem. An algorithm should be simple and clear. It must be to the point and should lead to the solution of the problem in a finite number of steps. 

In other words, the set of rules that define how a particular problem can be solved in a finite number of steps is known as an algorithm. An algorithm is composed of a finite set of steps, each of which may require one or more operations. Each operation must be definite, effective and finite.

Adding 3 number in C program  Algorithm 

Step1: Start the program

Step2: Input number a,b

Step3: store a, b

Step4: add and store in c (c←a+b)

Step5: Print c

Step6: Stop the program


A flowchart is a pictorial representation of an algorithm. We can also define it as a program planning tool for organizing a sequence of steps necessary to solve a problem, which is shown in terms of symbols.

It is used by the programmers to develop programs and by system, designers to represent the overall system while analyzing and developing the system.

Pseudo code

The general meaning of Pseudo code is false code or fake code. Before we write a real program, we write a program that looks like a code on the basis of algorithm and flowchart, which may not be syntactically correct but looks like a program code is called Pseudo code.

The instruction of pseudocode is written by using English phrases and mathematical expressions. 

It has no hard or fast rules for writing instruction but the instruction is closer to high-level language instructions.

Example: Pseudo code for calculating area of rectangle

Input length, breadth

Calculate area= length*breadth

Output area

Decision Table 

A decision table allows an analyst to identify the exact course of action for the given condition. A decision table provides clear decisions leading to a good program design. A decision table generally consists of two parts: Conditions and Actions.

This Content is helpful? Write your Responce