Print Primes

I do not understand the logic used in the loop. My result ultimately gives me the numbers that are divisible by the divisor