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

can anybody write the algorithm to display all the prime numbers between 1 and 100. Try to formulate a model for picking out the prime numbers from this range and describe the input,processing and the output intended

OpenStudy (anonymous):

you can use the sieve of eratosthenes or however his name is spelled/spelt

OpenStudy (appleduardo):

https://www.youtube.com/watch?v=wU5taAR5sPM take a look at this code, doesnt matter if you dont speak/understand spanish, if you know the basics on programming, youll get it very quick. If u have any doubts tag me

OpenStudy (e.mccormick):

ubah, what did you come up with? This is not an answer site. It is a help site.

OpenStudy (anonymous):

You could try using nested for loops. The first counting from 1-100, the second also counting from 1-100 then checking if first count has remainder 0 when divided by second, if it does then remove it from range(100). You'll be left with all the prime numbers. Since you're only running it to 100 the speed is irrelevant.

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!