Java program to check given number is prime number or not
Similar Questions: Prime Numbers Java Example Print prime numbers between 1 and given number using for loop //check to see if the number is prime boolean isPrime = true; for(int j=2; j < 10 ; j++){ if(10 % j == 0){ isPrime = false; break; } } // print the number if(isPrime) System.out.print(i + " ");