Problem 7 solution.
More...
#include <stdio.h>
#include <stdlib.h>
Problem 7 solution.
- See also
- Another version: problem_7/sol2.c
◆ main()
Main function.
- Returns
- 0 on exit
18 const unsigned target = 10001;
20 sieve = (
char *)
calloc(n,
sizeof(
char));
21 for (i = 2; i < n; i++)
32 for (j = i * 2; j < n; j += i)
int count(int *arr, const int size)
Count func counts the number of prime numbers.
Definition: prime_seive.c:42
#define free(ptr)
This macro replace the standard free function with free_dbg.
Definition: malloc_dbg.h:26
#define calloc(elemCount, elemSize)
This macro replace the standard calloc function with calloc_dbg.
Definition: malloc_dbg.h:22