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: achooo 2012-10-02 20:53

This is easy. I'll hint, then you give me a biscuit.

Make an array for primes for N/2,
make and integer, i, with a limit max of N,
Continuously increment i, and test that it is not divisible by 2 and it is not 2,
if not, increase i again and repeat loop from start,

save i to an array of i's,
Test in a loop that prime[i] is not divisible by prime[test],
if not, increase i again and repeat loop from start,

print i

Then print, "I am done teach. give me a biscuit."

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