You are viewing a single comment's thread. Return to all comments →
class Prime{ public void checkPrime(int... input){ boolean isPrime; for(int i: input){ isPrime = true; for(int j=2; j*j<=i; j++){ if(i%j == 0){ isPrime=false; break; } } if(isPrime && i!=1){ System.out.print(i + " "); } } System.out.println(); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Prime Checker
You are viewing a single comment's thread. Return to all comments →