NB: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes #include "stdio.h" #include "string.h" #include "stdlib.h" #…