doing n++ would give you a number divisible by two if it currently isn't, if i is divisible by a number that is divisible by two, then i is divisible by two, and as such is a waste of time as it has already been checked if i is divisible by two.
Suppose you want to test N for primality, everyone is using a loop like this
1 2
for(i=2;i<N/2;++i)
...
or similar (good plan to deal with divisor 2 first)
But you don't need to go up to N/2, int(sqrt(N)+0.5) is as far as you need to go. After this the quotient is getting smaller so you are retesting possible divisors you have done before, this time as the quotient.
Suppose N is a large prime around 1000000, then using int(sqrt(N)+0.5) you are trying divisors 2 to ~1000, but with N/2 you are trying divisors 2 to ~500000. A 500:1 performance ratio!
however, you can avoid some cycles by using n < sqrt(i) instead of i/2
Not to be that guy, but I thought I would point this out. Any cycles you save by only looping to the square root rather than half of the number are going to be nothing compared to the amount of cycles used to calculate sqrt() every iteration. If you are going to go that route, for the sake of efficiency, store the return value of sqrt() in a variable rather than recalculating it every iteration. Even then, you're only saving time when checking larger numbers, so adding an if to determine whether to use sqrt() or just half could be added for further efficiency.