Browse Source

exponent modulus logarithm potential calling

remotes/origin/Ulrich
Ulriche Nguefack 11 months ago
parent
commit
552010a1f9
  1. 26
      src/main/c/Calculator/calculator.c

26
src/main/c/Calculator/calculator.c

@ -184,16 +184,32 @@ void displayMenu() {
printf("19. Combination\n"); printf("19. Combination\n");
printf("20. Exit\n"); printf("20. Exit\n");
} }
int add(int num1, int num2) {
double add(double num1, double num2) {
return num1 + num2; return num1 + num2;
} }
int subtract(int num1, int num2) {
double subtract(double num1, double num2) {
return num1 - num2; return num1 - num2;
} }
int multiply(int num1, int num2) {
double multiply(double num1, double num2) {
return num1 * num2; return num1 * num2;
} }
int divide(int num1, int num2) {
double divide(double num1, double num2) {
return num1 / num2; return num1 / num2;
}
}
double exponent(double base, double exponent) {
return pow(base, exponent);
}
double modulus(double num1, double num2) {
return fmod(num1, num2);
}
double logarithm(double num) {
return log(num);
}
double potential(double base, double exponent) {
return pow(base, exponent);
}
Loading…
Cancel
Save