You are viewing a single comment's thread. Return to all comments →
Any views on performance...
public void checkPrime(int... nums){ for(int n:nums){ boolean isPrime = true; if(n>1){ for(int j=2;j<=n;j++){ if(n!=j && n%j == 0){ isPrime = false; break; } } if(isPrime){ System.out.print(n+" "); } } }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 →
Any views on performance...