Sorting and searching encryption and decryption

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: g, finding prime numbers Idea can be applied to any problem you want to write code to solve We'll be looking at some well known algorithms for this later in the semester Algorithms Check if a user entered number is prime Ask the user for a number to check the primeness of. Start with divisor equal to 2. If the user's number is divided evenly by the divisor, it is not prime. You are done. If the divisor squared is less than the user's number, increase it by one and go to step 3. If you've reached this step, the user's number is prime. 1. 2. 3. 4. 5. Algorithms Aspects of...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online