diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index 5110e69..abf70e0 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -1,5 +1,6 @@ #include -#include +#define M_PI 3.14159265358979323 + // Function prototypes void displayMenu(); @@ -9,6 +10,7 @@ int getIntInput(const char *message); double factorial(double num); double permutation(int n, int r); double combination(int n, int r); +double pow(double num1, int num2); int main() { int choice; @@ -146,3 +148,11 @@ int getIntInput(const char *message) { scanf("%d", &input); return input; } + +double pow(double num1, int num2){ + double product = 1; + for(int i = 0; i < num2; ){ + product *= num1; + } + return product; +} \ No newline at end of file