Answer
See explanation
Work Step by Step
The algorithm below calculates the factors of the given number.
n = input integer
factors = []
i=1
repeat:
if n%i==0:
factors.append(i)
if n/i != i:
factors.append(n/i)
i+=1
until(i*i>n)