A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

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

  • This Question is Closed
  1. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

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

  2. appleduardo
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  3. e.mccormick
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

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

  4. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.