From fdded408b1354efd2b62a2392dcb64180a71d5b5 Mon Sep 17 00:00:00 2001 From: fdai7848 Date: Mon, 29 Jan 2024 10:06:49 +0100 Subject: [PATCH] Add functionality to Exponent Function --- src/exponent.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/exponent.c b/src/exponent.c index 413f97c..ca2438f 100644 --- a/src/exponent.c +++ b/src/exponent.c @@ -1,5 +1,13 @@ #include "exponent.h" int expI(unsigned int e, int num){ - return 0; + int prod = 1; + if(e==0){ + return 1; + }else{ + for(int i = 1; i <=e; i++){ + prod *= num; + } + return prod; + } } \ No newline at end of file