
addprime = true;
for (checker = 1; checker <prime; checker++)
{
residu = prime%checker;
if(residu == 0 && checker != 1)addprime = false;
}
#include <iostream.h>
#include <math.h>
using namespace std;
int main(void){
int primelist[10000]={2,3}; //array to store all prime numbers
int pn=2; //number of primes in array
int i; //number to check if prime
int i2; //index of prime list
bool prime;
for(i=5;i<10000;i+=2){
for(i2=0,prime=true;primelist[i2]<=sqrt(i);i2++){
if(i%primelist[i2]==0)prime=false;
}
if(prime){
primelist[pn]=i;
pn++;
}
}
for(i=0;i<pn;i++)printf("%d\n",primelist[i]);
return 0;
}