View Single Post
Old Feb 14th, 2008, 5:19 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,886
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: finding prime using bool

Just as an aside, if you're generating a list of primes (as opposed to determining whether or not an arbitrary number is prime), the Sieve of Eratosthenes is a fairly intuitive and simple algorithm for doing just that. It's easy to implement, and might be a fun programming excercise for you. It's by no means necessary for the requirements of the program, but it will surely impress your teacher (if this is an assignment).
Sane is offline   Reply With Quote