This program is supposed to output the prime numbers between 1 and 100.
Will anyone please explain me the flow the programme below? I am having difficulty in writing the progra
public static List getPrimeNumbers(int from , int to) {
List list = new ArrayList<>();
for (int i = from;i <= to; i++) {
int count = 0;
for (int num = i; num>=1;num--) {
if(i%num == 0){
count++;
}
}
if(count ==2) {
list.add(i);
}
}
return list;
}