algorithm
algorithm
It involves various
constructs and statements to guide the process of computation. Here’s a breakdown of the key
components involved in an algorithm:
Attributes:
o Effectiveness: Each step must be basic enough to be carried out with a pencil and
paper.
Constructs:
2. Statements in an Algorithm
a. Input
b. Output
If (a > b)
Else
d. Looping (Iteration)
For i from 1 to 10
Print i
plaintext
Copy code
1. Start
3. Initialize sum = 0
4. For i from 1 to n
sum = sum + i
6. Stop