0% found this document useful (0 votes)
41 views5 pages

Theory

The document discusses algorithms and flowcharts. It defines what an algorithm is and its key characteristics like being unambiguous, having inputs and outputs, being finite, and being feasible. It also discusses flowcharts as a way to visually represent algorithms using standard symbols connected by flow lines. The document contrasts algorithms and flowcharts and provides an example algorithm and flowchart to add two numbers.

Uploaded by

Rashmi Deshpande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views5 pages

Theory

The document discusses algorithms and flowcharts. It defines what an algorithm is and its key characteristics like being unambiguous, having inputs and outputs, being finite, and being feasible. It also discusses flowcharts as a way to visually represent algorithms using standard symbols connected by flow lines. The document contrasts algorithms and flowcharts and provides an example algorithm and flowchart to add two numbers.

Uploaded by

Rashmi Deshpande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

What is an Algorithm?

1. Algorithm refers to a set of rules/instructions that step-by-step

define how a work is to be executed in order to get the expected

results.

Characteristics of an Algorithm
Not all procedures can be called an algorithm. An algorithm should have the
following characteristics −

 Unambiguous − Algorithm should be clear and unambiguous. Each of its


steps (or phases), and their inputs/outputs should be clear and must lead to
only one meaning.
 Input − An algorithm should have 0 or more well-defined inputs.
 Output − An algorithm should have 1 or more well-defined outputs, and
should match the desired output.
 Finiteness − Algorithms must terminate after a finite number of steps.
 Feasibility − Should be feasible with the available resources.
 Independent − An algorithm should have step-by-step directions, which
should be independent of any programming code.

Flowchart In Programming
1. A flowchart is a diagrammatic representation of an algorithm. A flowchart
can be helpful for both writing programs and explaining the program to
others.

2. Programmers often use it as a program-planning tool to solve a problem. It

makes use of symbols that are connected among them to indicate the flow of

information and processing.


3.The process of drawing a flowchart for an algorithm is known as

“flowcharting”.

Symbols Used In Flowchart


Symbol Purpose Description

Indicates the flow of logic by


Flow line
connecting symbols.

Terminal(Stop/ Represents the start and the end


Start) of a flowchart.

Used for input and output


Input/Output
operation.

Used for arithmetic operations


Processing
and data-manipulations.

Used for decision making


Decision between two or more
alternatives.
Difference between algorithm and flow chart:
S.
No Algorithm Flowchart
An algorithm is a step-by-step A flowchart is a diagram created with
1. procedure to solve a problem. different shapes to show the flow of data.
The algorithm is complex to
2. understand. A flowchart is easy to understand.
3. In the algorithm, plain text is used. In the flowchart, symbols/shapes are used.
4. The algorithm is easy to debug. A flowchart is hard to debug.
The algorithm is difficult to
5. construct. A flowchart is simple to construct.
The algorithm does not follow any
6. rules. The flowchart follows rules to be constructed.
The algorithm is the pseudo-code A flowchart is just a graphical representation
7. for the program. of that logic.

Algorithm and Flowchart to add two numbers


Algorithm:
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values for num1, num2.
Step 4: Add num1 and num2 and assign the result to a variable
sum.
Step 5: Display sum
Step 6: Stop

Flowchart :

You might also like