We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9464a36 commit 51a3124Copy full SHA for 51a3124
primalityTest/Sieve of Eratosthenes/SieveOfEratosthenes.c
@@ -1,8 +1,9 @@
1
#include <stdio.h>
2
3
-int main()
+void sieveOfEratosthenes(int number)
4
{
5
- int number = 100, i, j;
+
6
+ int i, j;
7
int primes[number + 1];
8
9
for (i = 2; i <= number; i++) //populating array with naturals numbers
@@ -35,6 +36,18 @@ int main()
35
36
}
37
38
39
+ for (i = 0; i < k; i++)
40
+ printf("%d ", result[i]);
41
42
+ printf("\n");
43
+}
44
45
+int main()
46
+{
47
+ int number = 100;
48
49
+ sieveOfEratosthenes(number);
50
51
return 0;
52
53
0 commit comments