Professional Documents
Culture Documents
Swe116 Algorithms-1
Swe116 Algorithms-1
(SWE116)
ALGORITHMS
8
4 January 2019 H.M Ojong@EMITINA
Example 2:
Write an algorithm for interchanging the numeric values of two
variables.
Solution:
1. START
2. PRINT “Enter the value of A and B”
3. INPUT A, B
4. C ← A
5. A ← B
6. B ← C
7. PRINT A, B
8. STOP
H.M Ojong@EMITINA 10
4 January 2019
B. Pseudocode:
̵ Has no standard or rule, and easy to write and use.
C. Flowcharts:
̵ Has standard shapes interconnected by flow lines.
̵ Activities to be performed are written within the shapes in
English.
Example 4:
Draw a flowchart to find the sum
of the first 100 natural numbers.