Finding Prime Numbers Using C++

Posted by Jiltin     Tags: , 16 November, 2008    933 views    (4) Comment

#include <iostream> #include <string> using namespace std; void main() {         int max;         cin> > max;         if(max <= 0)         {                 cout<<"Please enter a digit>  0\n";         }         int* primes;         int Read Full Article (Click here)...

Categories : Scripts Unix, Web & Scripts Tags : ,

Sieve of Eratosthenes mysql.

Posted by Jiltin     Tags: , , 18 October, 2008    413 views    (0) Comment

Opinions are devided as to whether it’s better to keep a list of prime numbers on disk or to generate them as needed. I do not have my own opinion on the subject but if you need to keep a list of primes on permanent storage here is a MySQL stored procedure to generate them and insert them into a table. The numbers are generated using the well known Sieve of Eratosthenes and stored into a very simple one column table. CREATE PROCEDURE sp_findPrimes(P INT) BEGIN DECLARE sqrt_p Read Full Article (Click here)...

Categories : Web & Scripts Tags : , ,

Prime Number Hunter Logic in PHP

Posted by Jiltin     Tags: , 18 October, 2008    2,942 views    (0) Comment

This is not my original php program. I have made prime number logic with visual basic, oracle plsql, c++ and C#. I got this from “Site With The Lamp” and reproduced for my reference. ================================================================= The following code is an Implementation of the Sieve of Eratosthenes in PHP. It’s purpose is to sieve the natural numbers and separate the primes from the composites. function find_primes($number)     Read Full Article (Click here)...

Categories : Web & Scripts Tags : ,