sieve of eratosthenes c


sieve of eratosthenes c

                            Online C Compiler.
                Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.



int main()
    int n,i,j; //declaring required variables
    bool arr[n+1]; //declaring an array which contains true and false values
    arr[1]=false; //setting the first index to false (1 is not a prime number)

        arr[i]=true; //we are assuming that all the numbers are true which means prime



Please follow and like us:
Content Protection by