public class Primes { public static void main(String[] args) { //Print the primes in the range 2 to 100 inclusive. outer: for (int n = 2; n <= 100; n = n + 1) { for (int i = 2; i < n; i = i + 1) { if (n % i == 0) { //n is not prime. continue outer; } } System.out.println(n); } } }