Primes or prime numbers are integers greater than 1 which are divisible only by themselves and 1, i.e.: 2, 3, 5, 7, 11, ... .
See Wikipedia on primes.
If your program for checking or computing prime numbers doesn't work, please check the following points before posting a question:
If it is too slow, try testing divisibility only up to and including the square root. If you want to compute all primes in a range better use the sieve of Eratosthenes, implemented properly it will be much faster.
If your algorithm says square numbers are prime you neglected the and including part above.
Check for overflow.
n * n
overflows a 32 bit signed integer forn > 46340
. The sum of the first two million primes for Project Euler problem 10 will also overflow a 32 bit integer.