You are viewing a single comment's thread. Return to all comments →
class Prime{ void checkPrime(int... a){
for(int i:a){ int check=0; for(int j=2;j<=i/2;j++){ if(i%j==0){ check=1; } } if(i==2 || i==3 ){ System.out.print(i+" "); } else if(check==0 && i!=1){ System.out.print(i+" "); } } lets try to ubderstand this 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 →
class Prime{ void checkPrime(int... a){
}