You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.; import java.lang.reflect.;
import static java.lang.System.in;
class Prime {
public void checkPrime (int... numbers){ for (int num : numbers) { if (num <= 2) { if (num == 2) { System.out.print(num+ " "); } else { } } else if (num % 2 == 0) { } else { for (int halfNum = (num / 2) ; halfNum >= 1 ; halfNum -= 2) { if (halfNum % 2 == 0) { halfNum++; } if (num % halfNum == 0){ // System.out.println(); if (halfNum >= 3) { break; } else { System.out.print(num+ " "); } } } } }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 →
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.; import java.lang.reflect.;
import static java.lang.System.in;
class Prime {
} }}