ALGORITHM:
1. An algorithm is defined as a finite sequence of explicit instructions, which when provided with a set of input values produces an output and then terminates.
2. To be an algorithm, the steps must be unambiguous and after a finite number of steps, the solution of the problem is achieved.
Example of algorithm::
Write an algorithm to add two numbers entered by user.
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop
FLOWCHART:-
• A flowchart is a pictorial representation of an algorithm in which the steps are drawn in the form of different shapes of boxes and the logical flow is indicated by interconnecting arrows.
• The boxes represent operations and the arrows represent the sequence in which the operations are implemented.
Benefits of Flowcharts
• Makes Logic Clear
• Communication
• Effective Analysis
• Useful in Coding
• Proper Testing and Debugging
•Appropriate Documentation
Limitations of Flowcharts
• Complex
• Costly
• Difficult to Modify
• No Update
Flowchart Symbols
• A flowchart uses special shapes to represent different types of actions or steps in a process.
• Some standard symbols, which are frequently required for flowcharts, are::
PSEUDOCODE:-
• Pseudo code is a generic way of describing an algorithm without using any specific programming language-related notations.
• It is an outline of a program, written in a form, which can easily be converted into real programming statements
Benefits of Pseudocode/advantage:-
• Pseudocode provides a simple method of developing the program logic as it uses everyday language to prepare a brief set of instructions in the order in which they appear in the completed program.
• Language independent
• Easier to develop a program from pseudocode than a flowchart
• Easy to translate pseudocode into a programming language
• Pseudocode is compact and does not tend to run over many pages
• Pseudocode allow programmers who work in different computer languages
Limitations of Pseudo code:-
• The main disadvantage is that it does not provide visual representation of the program’s logic.
• No accepted standards style of writing pseudo codes.
• Cannot be compiled or executed and there are no real formatting or syntax rules.
Example::
Calculate the sum of two number.
begin:
Read A,B
Set Sum := A+B.
Print Sum
end
.......Thanking you