-->

Facebook

Jasper Roberts - Blog

Wednesday, September 24, 2014

Algorithm

- Algorithm is a step-by-step solution of a given problem.

- In C Language, Algorithm represents the step-by-step solution.

- Advantages of Algorithm:
1. It is very easy technique to understand the logic of a given problem.
2. Simple and Very easy to write.
3. Mistakes can be identified very easily.

- Disadvantages of Algorithm:
1. Its very time consuming.
2. Very difficult to represent looping.
3. Complex and very big task are difficult to represent in algorithm.

- Example-1: An Algorithm for display " Hello World!! "
    Step-1: Start
    Step-2: Print "Hello World!!"
    Step-3: Stop.

- Example-2: An Algorithm to add two values.
    Step-1: Start
    Step-2: Input a,b
    Step-3: Calculate Sum = a + b
    Step-4: Print Sum
    Step-5: Stop.

Flow Chart

- Flow Chart is a graphical representation of a given problem.
- By using the various flow chart symbols we can represent a problem graphically


- Various Symbols of Flow Chart:

Flow Chart & Symbols
Flow Chart Symbols

- Example:
   Draw a Flow Chart to find out the largest number among three numbers.

Flow Chart
Largest Number Among Three Numbers