2.algorithm & Flowchart
2.algorithm & Flowchart
AND
FLOWCHART
ALGORITHM
Step 4: PRINT SI
Step 5: STOP
FLOWCHART
A flowchart is a diagrammatic representation of an algorithm, in which
different steps are shown as symbols of different shapes connected by
arrows. The arrows are responsible for the direction of flow of program.
Different shapes used in a flowchart and their functions are listed below:
Use of flowchart
A flowchart has only one START box and one STOP box.
The direction of flow in a flowchart is either from top to bottom or
from left to right
The flow of control follows only one path.
An example of how to draw a flowchart is given
below :-
Draw a flowchart to find the average of three numbers.
DECISION MAKING
A computer uses the IF... ELSE statement for decision-making.
When the condition after IF is true, the computer follows the
instructions after THEN.
When the condition after IF is false, the computer evaluates
instruction after ELSE and then proceed further. This process is also
known as conditional problem solving.
Note:
In algorithms, the IF... THEN... ELSE statement is used whereas in
flowcharts, IS... YES... NO is used through a decision box.
Below is an example of decision making with
algorithm and flowchart