int factor = num / 2; //begin from halfway, work way down to 1 (since 2 * (num / 2) = (num / 2) * 2)
You could also just get the square root here, it may be a bit faster.
int factor =...
Type: Posts; User: Breek
int factor = num / 2; //begin from halfway, work way down to 1 (since 2 * (num / 2) = (num / 2) * 2)
You could also just get the square root here, it may be a bit faster.
int factor =...
To find if a number is Perfect, really fast:
For values of n starting at 2 and going up, try:
(2^n - 1) This will give you the value of 3.
You can check if a number is prime with this...
Would anyone be so kind as to tell me how to get rid of the blinking cursor in C++?
Gimme some numbers: _ <--blinking
to
Gimme some numbers:
Additionally, does anyone know anything...