Solved

# Prime Numbers

Posted on 2004-09-28

hi there,

im trying to make a prog that generate the first 100 prime numbers

here is my code:

#include <stdio.h>

int main(void)

{

int x,a,f,p,teller;

a=2;

f=0;

//p=a-1;

for(x=1 ; x<1000;x++){

//for(p=1; p<a; p++){

if ((a%p !=0) && f<100){

for(p=1; p<a; p++){

// for(p=a; p>0; p--) {

// print("Priem

f++;

printf("Priemgetal %i: %i \n",f,a );

}

// p++;

a++;

}

//p++;

}

}

----------------------

and its not working here is how i want to make it i dont know if its good

prime number is

primenumber % primenumber -1 << and it have to loop intil 1

anyone can help me with it ?

other possible way is

primenumber % (1 to primenumber -1 )

plz help me im stuck

thanks in advance