Factors of an integer: Difference between revisions

Content added Content deleted
mNo edit summary
Line 2,951: Line 2,951:
lo=lo j /* add its square root */
lo=lo j /* add its square root */
return lo hi /* return both lists */</lang>
return lo hi /* return both lists */</lang>

=={{header|Ring}}==
<lang ring>
nArray = list(100)
n = 45
j = 0
for i = 1 to n
if n % i = 0 j = j + 1 nArray[j] = i ok
next

see "Factors of " + n + " = "
for i = 1 to j
see "" + nArray[i] + " "
next
</lang>


=={{header|Ruby}}==
=={{header|Ruby}}==