diff --git a/Algorithms/Maths/Sieve of Eratosthenes algorithm/java/sieve_of_eratosthenes.java b/Algorithms/Maths/Sieve of Eratosthenes algorithm/java/sieve_of_eratosthenes.java new file mode 100644 index 00000000..47abaf87 --- /dev/null +++ b/Algorithms/Maths/Sieve of Eratosthenes algorithm/java/sieve_of_eratosthenes.java @@ -0,0 +1,33 @@ +class SieveOfEratosthenes +{ + void sieveOfEratosthenes(int n) + { + boolean prime[] = new boolean[n+1]; + for(int i=0;i