Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 20 Online
OpenStudy (anonymous):

Help with ps1, printing the 1000th prime number. After a lot of trial and error I thought I was on the right track. Now I am stuck. http://codepaste.net/4dirtt. Suggestions? Should I just start over with a totally different approach?

OpenStudy (anonymous):

Can't access your code page. Can you please repost?

OpenStudy (anonymous):

Never mind. I see it now.

OpenStudy (anonymous):

remove the dot http://codepaste.net/4dirtt

OpenStudy (anonymous):

I inserted some print statements in your code for debugging. You can tell by running the modified app that you are not correctly generating the prime numbers. Take a closer look at what's going with your if statement. http://pastebin.com/jqve8bcg

OpenStudy (anonymous):

Here's the output of the code. http://pastebin.com/KD4A70zj

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!