You are not logged in. Please login at to post your questions!



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. :)

This question is marked "community wiki".

asked 26 Apr '15, 20:38

arpn's gravatar image

accept rate: 29%

wikified 27 Apr '15, 10:11

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.


answered 27 Apr '15, 09:23

dragonemperor's gravatar image

accept rate: 10%

Thank you :). Thanks a lot. :)

(27 Apr '15, 10:10) arpn4★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 26 Apr '15, 20:38

question was seen: 737 times

last updated: 27 Apr '15, 10:11