subject

Aprime number is any integer greater than 1 that’s evenly divisible only by itself and 1. the sieve of eratosthenes is a method of finding prime numbers. it operates as follows: a) create a primitive-type boolean array with all elements initialized to true. array elements with prime indices will remain true. all other array elements will eventually be set to false. b) starting with array index 2, determine whether a given element is true. if so, loop through the remainder of the array and set to false every element whose index is a multiple of the index for the element with value true. then continue the process with the next element with value true. for array index 2, all elements beyond element 2 in the array that have indices which are multiples of 2 (indices 4, 6, 8, 10, etc.) will be set to false; for array index 3, all elements beyond element 3 in the array that have indices which are multiples of 3 (indices 6, 9, 12, 15, etc.) will be set to false; and so on. when this process completes, the array elements that are still true indicate that the index is a prime number. these indices can be displayed. write an application that uses an array of 1,000 elements to determine and display the prime numbers between 2 and 999. ignore array elements 0 and 1.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Which action describes an aspect of technological design?
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
What engine component is shown in the above figure?
Answers: 1
question
Computers and Technology, 23.06.2019 07:10
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
question
Computers and Technology, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
You know the right answer?
Aprime number is any integer greater than 1 that’s evenly divisible only by itself and 1. the sieve...
Questions
question
English, 05.02.2021 15:10
Questions on the website: 13722360