main.swift212 chars13 lines
We loop through all numbers between 2 and 1000. For each number, we check if it is prime, by dividing it by all the numbers between 2 and the number itself (excluding the number itself). If it is divisible by any number, we mark it as not prime and break the loop. If it is not divisible by any number, we mark it as prime and print it.
gistlibby LogSnag