public class PrimeNumsW { public static void main(String[] args) { for (int i = 500; i <= 599; i++) { if (isPrime(i)) { System.out.println(i); } } } public static boolean checkPrime(int num) { if (num <= 1) return false; for (int i = 2; i <= Math.sqrt(num); i++) { if (num % i == 0) return false; } return true; } }