How to check quickly if a number is prime in C?