Tag Archives: c

Get all prime numbers up to given number using Sieve of Eratosthenes algorithm in c#

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For example, 5 is prime because only 1 and 5 divide it, whereas 6 is composite because it has the divisors 2 and 3 in addition to 1 and 6. And now if i say that find the all prime numbers up to 6 then there are three numbers 2,3 and 5. Continue reading Get all prime numbers up to given number using Sieve of Eratosthenes algorithm in c#