Algorithm & FLowchart

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

A sequence of activities to be processed for getting desired output from a given input.

Algorithm refers to a set of rules/instructions that step-by-step define how a work is


to be executed upon in order to get the expected results. The Algorithm are language-
independent, i.e. they are written in English like sentences that can be implemented
in any language, and yet the output will be the same

Properties of algorithm

1) Finiteness: An algorithm must always terminate after a finite number of steps. It


means after every step one reach closer to solution of the problem and after a finite
number of steps algorithm reaches to an end point.
2) Definiteness: Each step of an algorithm must be precisely defined. It is done by
well thought actions to be performed at each step of the algorithm. Also the actions
are defined unambiguously for each activity in the algorithm. 3) Input: Any operation
you perform need some beginning value/quantities associated with different activities
in the operation. So the value/quantities are given to the algorithm before it begins.

4) Output: One always expects output/result (expected value/quantities) in terms of


output from an algorithm. The result may be obtained at different stages of the
algorithm. If some result is from the intermediate stage of the operation then it is
known as intermediate result and result obtained at the end of algorithm is known as
end result. The output is expected value/quantities always have a specified relation to
the inputs.
5) Effectiveness: Algorithms to be developed/written using basic operations.
Actually operations should be basic, so that even they can in principle be done exactly
and in a finite amount of time by a person, by using paper and pencil only.

Advantages

 Easy to write.
 Human readable techniques to understand the logic.
 Algorithms for big problems can be written with moderate efforts.

Disadvantages

 Difficult to debug.
 Difficult to show branching and looping.
 Jumping (goto) makes it hard to trace some problems.

FLOWCHART
Definition

A flowchart is a pictorial or graphical representation of a process

Flowcharts normally use standard symbols to represent the different types of


instructions. These symbols are used to construct the flowchart and show the step-by-
step solution to the problem. The flow chart symbols are linked together with arrows
showing the process flow direction. This pictorial representation can give a step-by-
step solution to the given problem.
Advantages of Flowchart in C:
Following are the various advantages of flowchart:

o Communication: A flowchart is a better way of communicating the logic of a program.


o Synthesis: Flowchart is used as working models in designing new programs and software
systems.
o Efficient Coding: Flowcharts act as a guide for a programmer in writing the actual code in a
high-level language.
o Proper Debugging: Flowcharts help in the debugging process.
o Effective Analysis: Effective analysis of logical programs can be easily done with the help of a
related flowchart.
o Proper Documentation: Flowchart provides better and proper documentation. It consists of
various activities such as collecting, organizing, storing, and maintaining all related program
records.
o Testing: A flowchart helps in the testing process.
o Efficient program maintenance: The maintenance of the program becomes easy with the help
of a flowchart.

Disadvantages of Flowchart in C:
Following are the various disadvantages of flowchart:

o Time-consuming: Designing a flowchart is a very time-consuming process.


o Complex: It isn't easy to draw a flowchart for large and complex programs.
o There is no standard in the flowchart; there is no standard to determine the quantity of detail.
o Difficult to modify: It is very difficult to modify the existing flowchart.

o Design a flowchart for finding the largest among three numbers entered by the user.

Design a flowchart for finding the largest among three numbers entered by the user.

Design a flowchart for calculating the profit and loss according to the value entered by the
user.

You might also like