Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

do my homework for me

Name: Anonymous 2012-10-02 17:08

i need a program that finds all the primes under an arbitrary number and puts them on the console

have it ready by thursday at noon you faggots

Name: Anonymous 2012-10-02 19:08


long long primes[] ={ 2, 3, 5, 7, 11, 13, 17, 23}; // TODO: ADD THE REST OF THE PRIMES HERE
long long num = 8; // number of primes goes here
int main()
{
     int input = 0;
     printf("number:");
     scanf("%d",&input);
     for(int i = 0; i < num; i++)
     {
          if(primes[i] < input)
          {
               printf("%d",primes[i]);
          }
     }
     return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List