@ -42,3 +42,13 @@ printf("Error: Invalid input for logarithm!\n");
return 0;
}
// Function to calculate the natural logarithm (base e) of a number
float naturalLogarithm(float x) {
if (x > 0) {
return log(x);
} else {
printf("Error: Invalid input for natural logarithm!\n");