public class Prime { public static void main( String[] args ) { for (int num = 2; num < 20; num++) { if ( ifPrime(num) == true) { System.out.println( num + " < "); } else { System.out.println( num ); } } } public static boolean ifPrime(int n) { for (int i = 2;i < n;i++) if (n%i==0) { return false; } return true; } }