I have written a workable divisor algorithm that does this:

In order to get all divisors of a some number called "Num":

You search in the the range (1, num/2 + 1) and then do a for loop:

something like this:

for (int i =0; i < num; i ++){

if (num%i) == 0);

//add to the list of divisors

Someone else told me I need to make the range up to num/2 + 1 rather than num/2. Why the +1?