Write a program that computes and prints the 1000th prime number, can somebody help me?

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

Write a program that computes and prints the 1000th prime number, can somebody help me?

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

Show us what you got so far and we can work from there. It's better to give it a try first rather than just read someone's solution.
x=1 y=2 z=0 while z<10: if y<=x: if x%y==0: print x, x=x+2 y=2 z=z+1 else: y=y+1 else: x=x+2 z=z+1 y=2 i wrote this, try to run this and try to find the errors.thank you
Here is what I want you to do: Just before Print x, I want you to add Print x, y, x%y. You should notice y isn't doing exactly what you want it to do (reaches x instead of x-1) When trying to debug a program always add in Print statements. Print the variables and try to see if they match up to what you expect them to be. If not, try to figure out why it happened. If you need some more help with this particular problem let me know.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

what pogramming language is this???
python
kNicola thank you i finally find the solution by using the "for loop' rather than while
No problem. You could have also added an elif clause. elif y < x: y=y+1
Come on now, without giving it any thought at all, you can just cycle through the integers checking whether they are prime or not. Keep track of how many primes you have found so far. When you get to the thousandth one or whatever it is, return it.

Not the answer you are looking for?

Search for more explanations.

Ask your own question