|
@ -70,56 +70,11 @@ double combination(int n, int r); |
|
|
printf("19. Combination\n"); |
|
|
printf("19. Combination\n"); |
|
|
printf("20. Exit\n"); |
|
|
printf("20. Exit\n"); |
|
|
} |
|
|
} |
|
|
double add(double num1, double num2) { |
|
|
|
|
|
return num1 + num2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double subtract(double num1, double num2) { |
|
|
|
|
|
return num1 - num2; |
|
|
|
|
|
} |
|
|
|
|
|
double multiply(double num1, double num2) { |
|
|
|
|
|
return num1 * num2; |
|
|
|
|
|
} |
|
|
|
|
|
double divide(double num1, double 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 performOperation(int choice, double num1, double num2) { |
|
|
|
|
|
switch (choice) { |
|
|
|
|
|
|
|
|
double logarithm(double num) { |
|
|
|
|
|
return log(num); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double potential(double base, double exponent) { |
|
|
|
|
|
return pow(base, exponent); |
|
|
|
|
|
} |
|
|
|
|
|
double squareRoot(double num) { |
|
|
|
|
|
return sqrt(num); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double square(double num) { |
|
|
|
|
|
return num * num; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double cube(double num) { |
|
|
|
|
|
return num * num * num; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double cubeRoot(double num) { |
|
|
|
|
|
return cbrt(num); |
|
|
|
|
|
}double factorial(double num) { |
|
|
|
|
|
if (num == 0) { |
|
|
|
|
|
return 1; |
|
|
|
|
|
} else { |
|
|
|
|
|
return num * factorial(num - 1); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double power(double base, double exponent) { |
|
|
double power(double base, double exponent) { |
|
|
return pow(base, exponent); |
|
|
return pow(base, exponent); |
|
|