## Algorithm:

• An algorithm (pronounced AL-go-rith-um) is a well defined  procedure or formula for solving a problem
• An algorithm is a set of rules for solving a problem in a finite number of steps
• An algorithm is a sequential procedure that takes some values or set of values as an input and produce some values or set of values as output
• An algorithm is a step-by-step set of procedure to accomplish a particular task

Characteristics of an Algorithm:

The characteristics of a good algorithm are:

• PrecisionEach and every instruction should be precise and unambiguous i.e. each and every instruction should be clear and should have only one meaning
• Uniqueness – results of each step are uniquely defined and only depend on the input and the result of the preceding steps.
• Finiteness – the algorithm stops after execution of a finite number of instructions
• Input – the algorithm receives zero or more inputs.
• Output – the algorithm produces output at least one output.
• Generality – the algorithm applies to a set of inputs.

Development of Algorithm:

• Each algorithm will start with START step and end with STOP step
• READ or INPUT or ACCEPT are used to take the date from the user
• To display any message or content of variable to the user PRINT or DISPLAY is used as the keyword.
• following arithmatic operators are used in the expressions = assignment, + addition – subtraction *multiplication / division
• In propositions following relational operators are used ‘>’ greater than ‘<’ less tha ‘>=’ greater than equal to ‘<=’  less than equl to ‘=’equality ‘!=’ not equal to
• Logical operators are used as follows: ‘AND’ Conjunction  ‘OR’ disjunction ‘NOT’ Negation

An algorithm to find out the sum of two numbers

Algorithm to compare two numbers and print the message for greater one:

An algorithm to check whether the number is even or odd:

Write an algorithm to find largest among three numbers:

Method-1

Method-2

## Flow Chart:

• Flowchart is the pictorial/graphical representation of an algorithm.
• Flowcharts comprises of a set of various standard shaped boxes that are interconnected by flow lines.
• Flow lines have arrows to indicate the direction of the flow of control between the boxes.
• The activity to be performed is written within the boxes in English

Symbols used in the flow Charts: Types of flow chart:

1. Document flow chart: Showing the controls over a document flow through a system
2. Data flow chart:  Showing control over the data flow in the system.
3. system flow chart: Showing the control over the physical or resource level
4. program flow chart:  Showing the controls in a program with a system

Write and algorithm and draw the flow chart for finding the sum and product of two numbers:

Algorithm

Flow Chart

Write and algorithm and draw the flow chart for finding the sum of first 10 natural  numbers:

Algorithm

Flow Chart

Write and algorithm and draw the flow chart for finding larger between two  numbers:

Algorithm

Flow Chart