I am required to write a program which writes all the prime numbers between 1 and 10000, my only problem is that I cant find a way to determine the prime numbers from the rest! plz help! im not good at maths!
I wrote the following:
#include <stdio.h>
int prime (int);
int main ()
{
int i;
prime (i);
return 0;
}
int prime (int i)
{
i=1;
while ( i <=1000) {
if ( i % 2 == 1 && i % 3 == 1)
printf ("%d\n",i);
i++;
}
return i;
}