thanks for all the help you dont need to do anything else. happy posting!
You have (at least) two problems.
The first one is that the expression test % p in line 27 should be p & test.
The second is more subtle. Look at the loop in lines 23-32. You will see that the only way that your prime function can ever return anything but 0 is if the variable "test" reaches 0.
However, before it reaches 0, it has to reach 1--and when it does, line 27 will compute p % test (after you've fixed it) with test equal to 1, which will always be zero. So the function will always return zero.
I'm not going to tell you how to solve this problem, because I've already done enough of your homework for you.