answersLogoWhite

0


Best Answer

Well, you can create the flowchart to you, but here is the basic outline of what needs to be done.

Call your number - the number you want to test - "n".

Divide it by each integer in turn, starting with 2, and ending with "n-2". What matters here is the remainder of the division.

If at any point you get a remainder of zero, that means you have found a smaller factor, and the number is NOT a prime - it is composite. You can end the process immediately.

If you do all the divisions and DON'T get a remainder of zero at any point, there is NO smaller factor, so your number is prime.

(To make the process run faster, you can actually stop once your factor is greater than the square root of "n".)

User Avatar

Hilmar Zonneveld

Lvl 7
4y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you draw a flow chart to find out that a given number is prime or composite?
Write your answer...
Submit
Still have questions?
magnify glass
imp