java - remove and print prime numbers in an array -
I have an assignment for the class and the purpose is to take an array and it is run through a method The array will print out the reverse order, then test it to run through the second method, if the number is prime then print the reverse order array without the main numbers. I can fix the reverse order part, I'm getting bogged down in part of the main numbers:
My output is as follows:
11 22 14 7 8 10 0 0 0 0 0 I think that is actually cut off because it is the first assignment after a long break, so any guidance or help would be appreciated.
myArray2 is defined and never filled with values So every element is 0.
I think
for (int i = 0; i & lt; myArray2.length; i ++)
for (int i = 0; i & lt; myArray.length; i ++)
Comments
Post a Comment