APL, 40 13 bytes
2=+/0=x|⍨⍳x←⎕ Trial division with the same algorithm as my R answermy R answer. We assign x to the input from STDIN (⎕) and get the remainder for x divided by each integer from 1 to x. Each remainder is compared against 0, which gives us a vector of ones and zeros indicating which integers divide x. This is summed using +/ to get the number of divisors. If this number is exactly 2, this means the only divisors are 1 and x, and thus x is prime.