What is Pseudocode?
Pseudocode is a plain-language description of the steps in an algorithm or program. It's not
written in any specific programming language—just a logical sequence of steps that represents
how a solution will work.
Why Use Pseudocode?
• Helps to plan a program before writing actual code.
• Easy to understand for both programmers and non-programmers.
• Focuses on logic, not syntax.
Basic Structure of Pseudocode
1. Start and End – Always begin with Start and finish with End.
2. Input and Output – Use:
o Input to accept values.
o Output or Display to show results.
3. Processing/Computation – Use assignment statements, e.g. Total = Price * Quantity
4. Control Structures:
o If statements: For decision making
o Loops: For repeating actions (e.g., For, While)
5. Comments – Optional notes using // to explain parts of the pseudocode.
Example 1: Simple Calculation
Problem: Calculate and display the area of a rectangle.
Pseudocode:
Start
Input Length
Input Width
Area = Length * Width
Display Area
End
Example 2: Using If Statement
Problem: Check if a number is positive or negative.
Pseudocode:
Start
Input Number
If Number > 0 Then
Display "Positive"
Else
Display "Negative"
End If
End
Example 3: Using a Loop
Problem: Display numbers 1 to 5.
Pseudocode:
Start
For Counter = 1 to 5
Display Counter
End For
End