exercism-c/sieve/sieve.h
Blizzard Finnegan b92478b09c
Init commit
Leap, Difference of Squares, Grains, Collatz Conjecture, Queen Attack,
Darts, Hamming, and Space Age completed yesterday.

Binary and Linked List completed today.
2025-01-11 18:45:47 -05:00

13 lines
386 B
C

#ifndef SIEVE_H
#define SIEVE_H
#include <stdint.h>
#include <stddef.h>
/// Calculate at most `max_primes` prime numbers in the interval [2,limit]
/// using the Sieve of Eratosthenes and store the prime numbers in `primes`
/// in increasing order.
/// The function returns the number of calculate primes.
uint32_t sieve(uint32_t limit, uint32_t * primes, size_t max_primes);
#endif