PRIME1-HELP

help
prime1
wa

#1

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:


#2

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.


#3

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