From 7679c83e62435382fb5d57e2a198dd16d2f640ac Mon Sep 17 00:00:00 2001 From: fdai7446 <––fdai7446@fhfddvz1.rz.hs-fulda.de> Date: Fri, 10 Feb 2023 10:47:57 +0100 Subject: [PATCH] potenzieren --- Taschenrechner.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Taschenrechner.java b/Taschenrechner.java index ed7bac9..32ac949 100644 --- a/Taschenrechner.java +++ b/Taschenrechner.java @@ -15,4 +15,15 @@ public class Taschenrechner { return a / b; } + + int potenzieren(int a, int b) { + + int temp = 1; + + for(int i = 0; i < b; i++) { + temp = temp * a; + } + + return temp; + } }