public static void main(String[] args) {
int limit = 100;
System.out.println("Prime numbers between 1 and " + limit);
for(int i=1; i < 100; i++){
boolean isPrime = true;
for(int j=2; j < i ; j++){
if(i % j == 0){
isPrime = false;
break;
}}
// print the number
if(isPrime)
System.out.print(i + " ");
}}}
I want to compare the each element in the result .So i want to add this result into an array. How can i add the result of this program into a array?