does anyone know how to filter non-prime numbers out out of an array and replace them with zero's while leaving all of the prime numbers untouched and in the same position they had started at?
also without using multiplication, division, or mod in the process
Have a look at Eratosthenes' sieve (http://www.faust.fr.bw.schule.de/mhb/eratosiv.htm).
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.