PrimzahlenFinden
Aus ProgrammingWiki
Archivierte Version vom 2010-08-26T19:17:16+00:00. Aktuelle Version
<eval id="4c76bdbc4c38f"> boolean istPrimzahl(int n) { int counter = 2; boolean value = true; while(counter < n) { if((n % counter) == 0) { value = false; } counter++; } return value; }</eval>
for(x = 1; x < 1000; x++){
if(istPrimzahl(x)) {
if(909947 / x == (int)(909947 / x)) {
System.out.println(x);
}
}}