-1
I can’t get the prime numbers that are inside this List4 array; I’ve tried several ways, but without success. Currently, my code looks like this:
List<Integer> list8 = new ArrayList<>();
int numPrimo = 0;
int numDivisores = 0;
for (int i = 1; i <= list4.size(); i++) {
if (numPrimo % i == 0) {
numDivisores++;
}
if(numDivisores == 2) {
list8.add(numDivisores);
}
}
sysout("10) Os números primos entre as duas listas são: " + list8);
I need a light
Thanks, it worked super well and still cleared me a bigger doubt!
– eduardo
Not at all, and I’m glad he helped you.
– MatheusEdnei