check_prime.cpp (checks if input is a prime number)
Don't use using namespace std;.

Since is_prime only has two possible return values, and given its name implies a binary result, it should return a bool, not an int.  Then replace the return statements with the proper bool values.

When checking for primes, you only need to go up to the square root of the number to check.  This value can be computed once then used in the loop condition, or you can check for i * i &lt;= num, although this has the potential to overflow with sufficiently large num.

The check for 0 or 1 can be simplified to if (num &lt; 2).

Before the loop, you can check num to see if it is divisible by 2 and return an appropriate value.  Then you loop can start at 3 and increment by 2 (so you only need to check the odd numbers).

You should declare your variables as close to the place you first use them as possible, so your loop could be

for (unsigned long n = 3; ...


(or for (auto n = 3UL;).

When getting input, rather than while (1) with repeated conditions in the loop, you can say while (!cin.fail()) and not check for that within the loop.