PRIME1-HELP

I’m just a newbie, Iwas solving PRIME1 and my solution is here. Please help me where I’m doing wrong.

Thank you in advance. :slight_smile:

You have a line in main() : if(temp==m) temp+=p;

This line is wrong. Change it to if(temp==p) temp+=p;

This is because if the present value if itself a prime, we need to print it.

1 Like

Thank you :). Thanks a lot. :slight_smile: