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

First 100 Prime Nos.

Name: C++ 2009-08-10 6:32

I'm trying to make a program which displays the first 100 prime numbers. I've managed to make one which tells us whether a number is prime or not(http://pastebin.com/m38992e3e), but I cannot figure out how to print the first 100 prime nos.

Any help?

Name: Anonymous 2009-08-10 9:56

>>20
1 isn't a prime, by the usual definition of a prime number, as it only has one divisor(itself). Prime numbers require having 2 divisors (1 and the actual number, those two should be distinct), however 1 isn't a composite number. Think of 1 as a number which isn't prime and isn't composite, it's a more special element, called an identity element, such as 1 * n == n * 1. Look it up in wikipedia, which you so much treasure.

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