You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
412 B

package LernProgramm;
import java.util.Random;
import java.util.Scanner;
public class FunktionenAusgelagert {
public static void PrimBis100() {
for (int i = 2; i <= 100; i++) {
boolean istPrimZahl = true;
for (int j = 2; j < i; j++) {
if (i % j == 0) {
istPrimZahl = false;
break;
}
}
if (istPrimZahl) {
System.out.print(i + " ");
}
}
}
}