I would like to compute the divisors and prime divisors of a user defined integer using a for loop in a function. Having a hard time deciding if it would be best to do this in a for loop? Any help would be appreciated!
Heres some review, if you need it...
A divisor is a number that divides into another number without a remainder. So I guess it would be the opposite of % modulus division...
A Prime divisor is the same thing, but the divisor must be prime. IE the divisor can only be divided by itself and 1.
I know the for loop would be something like this for divisors:
Code:
for ( x=1; x<= i; x++ )
{
if ( x%i == 0 )
Dont know what else to put in the If and I dont know how to do that for Prime divisors...Any ideas?