Open main menu

CDOT Wiki β

Changes

GPU610/NullPointerException

16 bytes removed, 14:28, 7 February 2013
Assignment 1
while (count < n){
 
flag = 1;
 
i = 1;
 
checkKey = int((sqrt (prime))+1);
 
//checks prime numbers for divisible values
 
while(primes[i] < checkKey and flag){
 
if ((prime % primes[i])==0){
 
flag = 0;
 
}
 
i++;
 
}
 
if(flag){
 
primes[count] = prime;
 
count++;
 
}
 
prime +=2;
 
}