public class PrimeFinder { public static void main(String []args){ for (int x = 2; x <= 100; x++) { if (isPrime(x)) { System.out.println(x); } } } public static boolean isPrime(int n) { for (int a = 2; a < n; a++) { if (n % a == 0) { return false; } } return true; } }