- #1
Sir Arun
- 2
- 0
Problem Statement: Do the sieve of Eratosthenes from 2 to 100 and find all the primesSo I'm trying to do the sieve of Eratosthenes in fortran 90 (I'm using Plato IDE)My efforts to solve this/ method to use:
Obviously, I want the program to do a LOOP starting with every whole number from 2 onwards, and then get rid of all multiples of that number before the next LOOP starts with the next number and so on.
But how do I tell fortran that it should take a number and then strike all multiples of it, essentially getting rid of all composite numbers?Relevant equation: THATs the one I am searching for, which is why I need your help.
thanks for any help,
Sir Arun
Obviously, I want the program to do a LOOP starting with every whole number from 2 onwards, and then get rid of all multiples of that number before the next LOOP starts with the next number and so on.
But how do I tell fortran that it should take a number and then strike all multiples of it, essentially getting rid of all composite numbers?Relevant equation: THATs the one I am searching for, which is why I need your help.
thanks for any help,
Sir Arun
Last edited: