Algorithm,
Flowchart,
and
Pseudocode
A STEP-BY-STEP REPRESENTATION OF PROBLEM
SOLVING
What is an Algorithm?
An algorithm is a finite sequence of well-defined
instructions to solve a problem.
Characteristics:
- Input & Output
- Definiteness
- Finiteness
- Effectiveness
Problem Statement
Design an algorithm to find even number user-
provided values.
Step-by-Step Algorithm
Step 1: Start
Step 2: Input a number N
Step 3: If N % 2 == 0
Print "N is
even"
Step 4: Else
Print "N is odd"
Step 5: End
Flowchart Representation
Flowchart illustrating the decision-making to find
the even number.
Pseudocode
number = int(input("Enter a number: "))
if number % 2 == 0:
print("Even")
else:
print("Not Even")
Conclusion
- Each method helps in problem-solving and
planning.
- Flowcharts give a visual representation.
- Pseudocode acts as a bridge between
algorithm and code.