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
you can use the sieve of eratosthenes or however his name is spelled/spelt
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
ubah, what did you come up with? This is not an answer site. It is a help site.
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.
Join our real-time social learning platform and learn together with your friends!