From 06459ab13025749b031282c5031b1a5249c8b981 Mon Sep 17 00:00:00 2001 From: Habib Date: Sat, 3 Feb 2024 03:18:17 +0100 Subject: [PATCH] power() definiert --- src/c/funktionen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index d470068..21abaa1 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -31,4 +31,14 @@ int subtract(int num1, int num2) { int divide(int num1, int num2) { return num1 / num2; +} + +int power(int base, int power) { + int speicher = 1; + + for (int i = 0; i < power; i++) { + speicher *= base; + } + + return speicher; } \ No newline at end of file