ALGORITHM AND FLOWCHART
1. Algorithm
Meaning:
An algorithm is a step-by-step method used to solve a problem.
Characteristics of a Good Algorithm:
1. Clear
2. Correct
3. Finite
4. Ordered
5. Effective
Example Algorithm (Sum of Two Numbers):
1. Start
2. Input A
3. Input B
4. C = A + B
5. Display C
6. Stop
Uses of Algorithm:
- Helps in planning programs
- Makes coding easier
- Reduces errors
- Improves understanding
2. Flowchart
Meaning:
A flowchart is a diagram that shows steps of solving a problem using symbols.
Common Flowchart Symbols:
Symbol Name Shape Use
Start/Stop Oval Begin or End
Input/Output Parallelogram Read or Display Data
Process Rectangle Calculation
Decision Diamond Yes/No Condition
Flow Line Arrow Direction of Flow
Example Flowchart (Sum of Two Numbers):
Start → Input A,B → C = A + B → Display C → Stop
Uses of Flowchart:
- Makes programs easy to understand
- Shows logic clearly
- Helps in debugging
- Saves time in coding
3. Difference Between Algorithm and Flowchart
Algorithm Flowchart
Written in words Drawn with symbols
Text form Diagram form
Easy to write Easy to understand
Step list Picture steps
Conclusion
Algorithms and flowcharts are important tools in programming. They help programmers plan and understand
programs easily.