Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  mm
Language: JAVA
Code:
public class Db5o6Axs {
    public static void main(String[] args) {   
     int counter=0;
     int[] array = new int[16];

        for (int i = 2; i < 15; i++) {   
            boolean isprime = true;   
            for (int j = 2; j < i; j++) {   
                if (i > 1 && j < i && i % j == 0) {   
                    isprime = false;   
                    break;   
                }   
            }   
    
            if (isprime) {   
                array[counter] = i;
          System.out.print(array[counter]+"\n");    
                counter++;
            
            } else  
                System.out.print("");   
        }   
    }  

}          
Comments: