This question already has an answer here:
- Is this number a prime? 287 answers
Write a program that tests if a number
n is prime by checking that none of the integers between
n-1 (inclusive) divide
n (you must use this algorithm!). The input to STDIN should be an integer
n (strictly) greater than 1. The output to STDOUT should be
n is prime and
not prime if
n is not prime.
Even though you are intentionally writing an inefficient program, this is still code golf, fellas. Standard CG rules apply. Shortest code in bytes wins.