Actually, you've got things just about right. The problem is that you are calling main() from the other functions. Don't do that.
In between lines 16 and 17 add:
while (TRUE) {
end the while statement between lines 41 and 42: }
Then, get rid of every instance of main(); . That is, get rid of lines:
39, 52, 53, 55, 71, and 85.
You might also want to reconsider why so many of your functions return a value. For example,checkPrime() always returns zero, and the return value is ignored anyway (line 28), so just make it
void checkPrime( int );
and
void checkPrime( int number ) {
int n=number, den;
for(den=2; den*den<=number; ++den){
if(number%den==0){
printf("Your number is not prime.\n It is divisible by %d.\n", den);
return;
}
printf("Your number is prime.\n");
}
Hope this helps.