Julia, 46 bytes
n=int(ARGS[1]);show(sum([n%i==0for i=1:n])==2)
An integer is read as the first command line argument using int(ARGS[1])
and the result is printed to STDOUT using show
. Primality is checked using trial division with the same formulation as my R answermy R answer.
Note that the builtin function isprime
uses the Miller-Rabin algorithm, which is probabilistic and is thus unsuitable for this challenge. (Thanks to Martin Büttner for pointing that out.)
Saved 4 bytes thanks to kvill.