- 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.
- 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.
No comments:
Post a Comment