cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
funtion of Perfect Square/ prime number
funtion of Perfect Square/ prime number
Oct 14, 2015 at 1:27am UTC
michirules1992
(1)
I am trying to create a simple function that checks if a number that is entered by a user is a perfect square and another function that also checks if that same number is a prime number.
Oct 14, 2015 at 1:34am UTC
closed account (
48T7M4Gy
)
Whatever you do see whether it is quicker to check for primalty first, because no primes are perfect squares.
Eratosthenes seive is an extremely simple and effective way of finding prime numbers, not so good for checking primalty though.
Topic archived. No new replies allowed.