answersLogoWhite

0

Here is a very simple algorithm: Call your number "n". You might test divisibility by every number, starting at 2. If the first number by which a number is divisible is equal to "n", then it is a Prime number. - Faster algorithms are possible; for example, you really only need to test divisibility by all numbers, up to the square root of your number "n".

Here is a very simple algorithm: Call your number "n". You might test divisibility by every number, starting at 2. If the first number by which a number is divisible is equal to "n", then it is a prime number. - Faster algorithms are possible; for example, you really only need to test divisibility by all numbers, up to the square root of your number "n".

Here is a very simple algorithm: Call your number "n". You might test divisibility by every number, starting at 2. If the first number by which a number is divisible is equal to "n", then it is a prime number. - Faster algorithms are possible; for example, you really only need to test divisibility by all numbers, up to the square root of your number "n".

Here is a very simple algorithm: Call your number "n". You might test divisibility by every number, starting at 2. If the first number by which a number is divisible is equal to "n", then it is a prime number. - Faster algorithms are possible; for example, you really only need to test divisibility by all numbers, up to the square root of your number "n".

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
ReneRene
Change my mind. I dare you.
Chat with Rene
More answers

Here is a very simple algorithm: Call your number "n". You might test divisibility by every number, starting at 2. If the first number by which a number is divisible is equal to "n", then it is a prime number. - Faster algorithms are possible; for example, you really only need to test divisibility by all numbers, up to the square root of your number "n".

User Avatar

Wiki User

15y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What is the algorithm for prime numbers in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp