And you should write two recursive functions yourself
to help with the task. (Which means, these functions should not
have any loops and they they should make recursive calls to themselves):

// Reads a single number from the terminal that is at least
// as large as the given integer.
// If the user enters a number too small, they will repeatedly
// be prompted again and again until they enter a number that
// is large enough.
int getnum(int atleast);
// Returns the number of primes between a and b.
// The count is inclusive meaning that if a or be is a prime,
// they should be included in the count.
int countprimes(int a, int b);

Here are a few example runs to demonstrate how your
program should work. If you use the functions that you created
above, your main method should be pretty simple!

roche@ubuntu$ ./countprimesEnter a number at least 1: 10Enter a number at least 10: 20There are 4 primes between 10 and 20.

roche@ubuntu$ ./countprimesEnter a number at least 1: 11Enter a number at least 11: 19There are 4 primes between 11 and 19.

roche@ubuntu$ ./countprimesEnter a number at least 1: 20Enter a number at least 20: 10Too small!Enter a number at least 20: 10Too small!Enter a number at least 20: 21There are 0 primes between 20 and 21.

roche@ubuntu$ ./countprimesEnter a number at least 1: -1Too small!Enter a number at least 1: 1Enter a number at least 1: 1000There are 168 primes between 1 and 1000.

Material contained above is made available
for the purpose of peer review and discussion and does not
necessarily reflect the views of the Department of the Navy or the
Department of Defense.
Some links above are to sites that are not
located at the United States Naval Academy. The USNA is not
responsible for the content found on these sites. In addition, the
content of these sites does not reflect the opinions, standards,
policy or endorsement of the Naval Academy or the United States
Government.