- 1
What should be the logic for printing prime numbers between two integers?
3 Respostas
+ 3
You could study some of the codes created by other users to get some ideas:
https://code.sololearn.com/cp5O27Ji3qC6/?ref=app
https://code.sololearn.com/cuJofI7I6AFe/?ref=app
https://code.sololearn.com/cjrJpfzErm3z/?ref=app
https://code.sololearn.com/c9u1qclOzDmJ/?ref=app
You could also look into some articles discussing this topic on the web, such as the following:
https://prepinsta.com/cpp-program/cpp-program-to-find-prime-numbers-in-a-given-range/
+ 1
a google search will give you an exhaustive serch result.
0
https://en.m.wikipedia.org/wiki/Sieve_of_Eratosthenes , or if you want something more modern (by about 2000 years) https://en.m.wikipedia.org/wiki/Sieve_of_Atkin