Mike Shannon - Code Examples http://www.mikeshannon.com/taxonomy/term/1/0 en How to Print Prime Numbers, a C++ Example http://www.mikeshannon.com/how-to-print-prime-numbers <p>The following code uses the <a href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes">Sieve of Eratosthenes</a> method to print all prime numbers in the range of 2 to n, while n being the upper limit, command line integer you feed into the program. You could also just hard code n if you wanted to. Since it's in C++, this code can easily be ported to PHP or other languages that share similar syntax.</p> <p><a href="http://www.mikeshannon.com/how-to-print-prime-numbers" target="_blank">read more</a></p> http://www.mikeshannon.com/how-to-print-prime-numbers#comments Code Examples How To Mon, 21 Sep 2009 02:18:20 +0000 admin 95 at http://www.mikeshannon.com