didn't see it earlier but this is another infinate loop unless f = (2^31-1)Code:do { prod = 1; prod = prod * f; }while ( prod <= (2^31-1));
And what do you want to count?
didn't see it earlier but this is another infinate loop unless f = (2^31-1)Code:do { prod = 1; prod = prod * f; }while ( prod <= (2^31-1));
And what do you want to count?
the factors that the integer has.
How would you re-write the code ?
Thank you
Before starting to count anything, get the basic program right. Thantos already provided you with some feedback, try implementing some of that first. No point trying to run if you can't walk, or so they say.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Just got reminded that the ^ is not a power operator but a bitwise XOR.
Thank you guys for your help. I think I will need your expertise in the near future.