You are viewing a single comment's thread. Return to all comments →
import static java.lang.System.in; class Prime { void checkPrime(int ... nums) { for(int i:nums) { if(isPrime(i)==true && i!=1) { System.out.print(i+" "); } } System.out.println(); } public static boolean isPrime(int n){ for(int i=2; i<=n/2; i++) { if(n%i==0) return false; } return true; } }****
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 →