From cecd7ea8ecb6c419dcf86d6ec7b39c9b24699f58 Mon Sep 17 00:00:00 2001 From: jannisfingerhut Date: Fri, 10 Feb 2023 01:19:20 +0100 Subject: [PATCH] =?UTF-8?q?Funktion=20PrimBis100=20=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LernProgramm/ProgrammMain.java | 19 ++++++++++++++++++- bin/LernProgramm/ProgrammMain.class | Bin 4072 -> 4393 bytes 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/LernProgramm/ProgrammMain.java b/LernProgramm/ProgrammMain.java index 0ca4700..e366f97 100644 --- a/LernProgramm/ProgrammMain.java +++ b/LernProgramm/ProgrammMain.java @@ -67,6 +67,23 @@ public class ProgrammMain { } } } + + +// Prinmbis100 + public static void PrimBis100() { + for (int i = 2; i <= 100; i++) { + boolean isPrime = true; + for (int j = 2; j < i; j++) { + if (i % j == 0) { + isPrime = false; + break; + } + } + if (isPrime) { + System.out.print(i + " "); + } + } + } @@ -91,7 +108,7 @@ public class ProgrammMain { //Funktion break; case 3: - System.out.println("Diese Funktion wird derzeit entwickelt! Hab bitte etwas Geduld oder sei kreativ und erstelle dir selber eine Funktion!"); + PrimBis100(); //Funktion break; case 4: diff --git a/bin/LernProgramm/ProgrammMain.class b/bin/LernProgramm/ProgrammMain.class index 0d68fb8e05d73cfa7fe57a7aa57f1fb8d297f146..bb5bb366f39d91ab5309137fe4cfca7566cbc68d 100644 GIT binary patch delta 874 zcmYL`Sx-|@6otQ2+TQlkFa;E96ALB+CKM3V2N@y`5d@qP5{#lH6f9yz28|d)H27#D zxi4ybF&ZllD5#}^;sD}=6At(jeDqbK;J$(}Cu^^L_T77(bJqR7v@av!_3ZE{P{KD2 ziz2PJH*Fw$jn=4dYYQGM3%2Ly<>`31?&1bF71|MhOJ`tfqar1%JiD^lf5e~L;tw_D z?(Ap_hMLwo=vOGOPA+#`3{ar3waS+csRm^{*ly|uWVcJuY}9EP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