First off, you need to provide a function prototype before the definition of
main
:
int checkPrime(int n, int j);
Second, you have commented out the bit that makes it work:
checkPrime(n,j-1);
Third, why on earth is this recursive anyway? Use a loop instead - recursive methods will crash very quickly if you provide a large input as the stack is not very big...
Fourth, read the question again. Your code will not do what your teacher wants: the next largest prime greater than a given number.
Get a loop-based prime test working first, then think about the rest of the question.